Ir ao conteúdo

Exercicio 1 – Sistemas Operacionais II – INE5424 – UFSC

Trabalho 1 – EPOS
Idle-waiting Thread Joining
– Este trabalho tinha como objetivo alterar o modo que era feito o “join” em uma Thread. Sendo que o mesmo inicialmente era feito da seguinte maneira:
[code lang=”c”] while(_state != FINISHING)
yield();
[/code]

O mesmo consiste basicamente, em verificar o estado da thread que se esta dando join e caso o estado nao seja FINISHING dar a vez a outro processo. Esta solucao, acarreta no consumo excessivo de recursos ja que o mesmo sempre retorna para a fila de _ready. E eh executado novamente quando o escalonador escolher esta thread. O trabalho pede que seja modificado de modo que o consumo de recursos nao seja excessivo.

Arquivos Modificados:
thread.cc
Thread.h

Solucao:
     Foi criada uma variável adicional em threads.h, _waiting_for_me, que é um ponteiro para uma thread. Quando o método “join” é chamado, a thread que está executando é colocada no _waiting_for_me da thread chamada e é suspensa. Se a thread já finalizou ou alguém já chamou “join” nela, nada é feito. No método “exit”, caso _waiting_for_me esteja preenchida, é chamado o método “resume” na thread referenciada.
     Pensamos em colocar uma lista de referências para várias threads poderem dar “join” na mesma thread, porém vimos na documentação do POSIX que isso era considerado um erro lógico, e achamos que acarretaria um consumo de recursos adicional desnecessário, pois não seria possível usar o _link já existente na thread, já que ela teria de estar tanto na lista de suspensos quanto na lista _waiting_for_me da outra thread.

Explicacao mais detalhada da implementacao escolhida e outras solucoes pensadas.

7.061 Comentários

  1. mobile slots no deposit bonus usa, record win online casino
    [Aimee] casino with free signup bonus real money canada and casino reviews usa,
    or free spins goukos quest

  2. Felt like I was reading something written by someone who actually thinks about the topic rather than reciting it, and a look at wwqiw8 reinforced that impression, the difference between recited content and considered content is huge and this site clearly belongs to the latter category which I appreciate as a careful reader looking for substance.

  3. Thanks again for the post, I learned a couple of things I can actually use later this week, and after I went over biyoueki-se the rest of the site looked equally promising, definitely going to spend more time here when I get a free moment over the weekend to read more carefully.

  4. Took a chance on the headline and was rewarded, and a stop at julyelm kept the rewards coming as I clicked through, the kind of place where every link leads somewhere worth the click is a small luxury on the modern web where so many sites are mostly empty calories disguised as content.

  5. Skipped the comments section but might come back to read it, and a stop at wwqiw8 hinted at a quality reader community, sites where the comments are worth reading separately from the post are increasingly rare and signal a particular kind of audience that has grown around the editorial vision over time gradually.

  6. If a friend asked me where to read carefully on the topic I would send them here without hesitation, and a look at glyphfig confirmed the recommendation strength, the directness of my recommendation reflects how confident I am in the quality and this site has earned undiluted recommendations from me across multiple recent conversations actually.

  7. Слушайте кто ремонт затеял Хотел стену снести между комнатами Разрешения эти дурацкие Нервов просто не осталось Короче, ребята реально толковые — услуги по перепланировке квартир под ключ И чертежи сделали В общем, смотрите сами по ссылке — узаконивание перепланировки квартиры https://pereplanirovka-kvartir-owy.ru Не начинайте без проекта Перешлите тому кто тоже ремонт затеял

  8. Closed and reopened the tab three times before finally finishing, and a stop at havenfoam held my attention straight through, sometimes content fights for time against my own distraction and the times it wins say something positive about its quality and this post clearly won that fight today afternoon for me.

  9. 200 free spins no deposit usa casinos, the biggest casino in usa and australian online no deposit casino, or online casino canada free bonus

    Feel free to visit my web page; barbuzzo roulette shots
    rules (Margart)

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *