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.
Honestly enjoyed every minute spent here, that is not something I say lightly, and a look at simplelivingmarket confirmed I will be back, the bar for spending time online is high for me these days but this site clears it without effort which is high praise indeed from this reader who is usually rather demanding.
Skipped the social share buttons but might come back to actually use one later, and a stop at globaltrendoutlet extended that share urge, content that triggers genuine sharing impulses rather than performative ones is content that has actually moved me and not many posts in a typical week do that for me actually.
My professional context would benefit from having this kind of resource available, and a look at wildwoodfashion 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.
Worth pointing out that the post avoided the temptation to summarise everything at the end, and a look at honestharvesthub continued that confident closing approach, content that trusts readers to retain the substance without being reminded of it at the end is content that respects the reader and this site practices that respect.
Liked that there was nothing performative about the writing, and a stop at findpurposeandpeace continued that genuine quality, performative writing tries to be witnessed rather than read and the difference between performance and substance is huge for the careful reader and this site has clearly chosen substance every time clearly.
A piece that exhibited the kind of patience that good writing requires, and a look at happylivingoutlet continued that patient quality, hurried writing is easy to spot and this site reads as having been written without time pressure which produces a different feel than the rushed content that dominates much of the modern blog space.
Felt the writer respected the topic without being precious about it, and a look at globaltrendoutlet continued that respectful but unfussy treatment, finding the right register for serious topics is hard and this site has clearly figured out how to take the topic seriously while still being readable for casual visitors regularly.