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.

6.310 Comentários

  1. Now adjusting my mental list of reliable sites for this topic, and a stop at focuspowersmomentum reinforced the adjustment, the small ongoing curation work of maintaining trusted sources is one of the actual practical activities of careful reading and this site has earned a permanent place on my list for this particular subject.

  2. Thanks for the breakdown, it gave me a clearer picture of something I had been confused about for a while now, and a stop at shopneststore closed the remaining gaps in my understanding nicely, no need to hunt around twenty other articles to put the pieces together which is a real time saver.

  3. Worth observing that the post landed without needing a flashy headline to hook attention, and a stop at directionmattersmost did the same, content that earns engagement through substance rather than packaging is the kind I trust more deeply and this site has clearly chosen substance as the primary lever for reader engagement throughout.

  4. Solid post, the structure is easy to follow and the language stays simple even when the topic gets a bit more involved, and a look at momentumstream kept that same standard going, so I left feeling like the time spent here was actually worth something for once which is rare lately.

  5. Now realising this site has been quietly doing good work for longer than I knew, and a look at draftlog suggested an archive worth exploring, sites with deep archives of consistent quality represent a different kind of resource than sites with viral hits and this one looks like the durable kind based on what I see.

  6. Claudeflado Claudeflado

    В данной публикации мы поговорим о процессе восстановления от зависимости, о том, как вернуть себе нормальную жизнь. Мы обсудим преодоление трудностей, значимость поддержки и наличие программ реабилитации. Читатели смогут узнать о ключевых шагах к успешному восстановлению.
    Изучить рекомендации специалистов – kostroma clinica plus

  7. Closed the post with a small satisfied sigh, and a stop at directionmattersmost produced the same gentle exhale, content that ends well is content that respects the rhythm of reading and the writers here have clearly thought about how their pieces close rather than just trailing off when they run out of things to say.

  8. Now setting this aside as a model of how to write thoughtfully on the topic, and a stop at momentumframework extended that model status, content that becomes a reference for how a kind of writing should be done is content with influence beyond its own readership and this site is reaching that level for me clearly today.

  9. Started thinking about my own writing differently after reading, and a look at forwardclarityhub continued that reflective effect, content that influences how I work rather than just informing what I know is content with the highest kind of impact and this site has triggered some of that reflective influence today on me.

Deixe um comentário

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