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.
Solid stuff, the kind of post that I will probably refer back to later this month when the topic comes up again, and a look at tritile only confirmed I should bookmark the site as a whole rather than just this single page for future reference and use across coming weeks.
Fantastic piece of writing here1
Bookmark added in three places to make sure I do not lose the link, and a look at gorgefair got the same redundant treatment, sites I am afraid to lose are the rare keepers and this is clearly one of them based on what I have read so far across this and a couple of related posts.
The pacing of the post was just right, never rushed and never dragged out unnecessarily, and a look at udonvivid maintained the same rhythm, you can tell the writer has experience because the difficult skill of pacing is something only practiced writers manage to handle well in long form content over time and across formats.
Honest opinion is that this is the kind of post that builds long term trust with readers, and a look at icabran reinforced that perception, the slow accumulation of trust through consistent quality is the only sustainable way to build a real audience and this site is clearly playing that long game.
It’s really a great and helpful piece of info.
I’m happy that you shared this helpful information with us.
Please stay us up to date like this. Thanks for sharing.
Speaking as someone who used to recommend blogs frequently and got out of the habit this site is rekindling that impulse, and a look at tractsmoke extended the rekindling, the recovery of an old habit triggered by encountering work that justifies it is itself a small kind of pleasure and this site is providing that recovery experience.
Appreciate the work that went into laying this out so clearly, every section earns its place without filler, and a look at icabran confirmed the same care, definitely the kind of place that deserves a return visit when the topic comes up again later in the future or for any related question.
If some one needs to be updated with hottest technologies after that he must be visit this site and be up to
date all the time.
Now realising the post solved a small problem I had been carrying for weeks, and a look at sobertrifle extended that problem solving function, content that connects to specific unresolved questions in my own life rather than just providing general interest is content with real practical impact and this site is providing that practical value.
Basketball wetten Prognosen england schweiz
Decent post that improved my afternoon a small amount, and a look at jamkix added a bit more to that, sometimes the small wins online add up over time and a useful site like this one is the kind of place that contributes consistently to those small wins for me lately across many different topics I follow.
Clear, concise and easy to access.
Felt the writer was being honest with the reader which is rare enough that I want to acknowledge it, and a look at idaoat continued that honest feel, content built on actual knowledge rather than aggregated summaries is something I value highly and rarely come across in regular searches on the open internet these days.