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.

4.063 Comentários

  1. My professional context would benefit from having this kind of resource available, and a look at clevebound extended the professional applicability, the rare site that contributes meaningfully to professional work rather than just personal interest is content with multiplied value and this one is providing that professional utility consistently across multiple pieces.

  2. Reading this prompted me to dig out an old reference book related to the topic, and a stop at flockfine extended that connection to other sources, content that connects me back to my own existing knowledge rather than asking me to forget it is content with continuity and this site has that continuous quality.

  3. Speaking from the perspective of a fairly demanding reader the writing here clears the bar consistently, and a look at modernconsciousmarket continued clearing that bar, the calibration of demanding reader is something I apply to all sources and this site has been one of the few that handles the demanding reading well across pieces sampled.

  4. Reading more of the archives is now on my plan for the weekend, and a stop at neatmills confirmed the archive worth the time, the rare archive worth a dedicated reading session rather than just casual sampling is the rare archive of serious work and this site has clearly produced enough of that work to warrant the deeper exploration.

  5. Even just sampling a few posts the consistency is what stands out, and a look at bracecloth confirmed the broader pattern, sites where every piece I sample lives up to the standard set by the others are sites with serious quality control and this one has clearly invested in whatever editorial process produces that consistency reliably.

  6. I visited many blogs except the audio quality for audio songs present at this web page
    is truly fabulous.

  7. A piece that was confident enough to leave some questions open rather than forcing closure, and a look at falconfern continued that intellectual honesty, content that admits the limits of its scope is more trustworthy than content that pretends to total understanding and this site has the right calibration on certainty consistently.

  8. Now feeling the quiet pleasure of finding writing that takes itself seriously without being self serious, and a stop at hueheron extended that subtle pleasure, the gap between earnest and pretentious is fine and this site has clearly chosen to land on the earnest side without slipping over into pretentious which is impressive.

  9. A small thank you note from me to the team behind this work, the post earned it, and a stop at grebeknot suggested more thanks would be in order over time, recognising the people who do good writing online is something I try to remember to do because the alternative is silence and silence rewards mediocrity unfortunately.

  10. Even just sampling a few posts the consistency is what stands out, and a look at bracecloth confirmed the broader pattern, sites where every piece I sample lives up to the standard set by the others are sites with serious quality control and this one has clearly invested in whatever editorial process produces that consistency reliably.

  11. Picked this for a morning recommendation in our company chat, and a look at hueheron suggested I will mention this site again later, recommending content into a workplace context is a small editorial act that requires confidence in the recommendation and this site is making me confident in those recommendations consistently here too.

  12. I learned more from this short post than from longer articles I read earlier today, and a stop at koalaglade added even more useful detail without going off topic, this site clearly knows how to keep things focused without sacrificing depth which is a hard balance to strike for any writer.

  13. After reading several posts back to back the consistent voice across them is impressive, and a stop at gablejuno continued that voice consistency, sites that maintain a single coherent voice across many pieces by potentially many writers represent serious editorial discipline and this one has clearly developed the institutional consistency needed for that.

Deixe um comentário

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