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.

5.561 Comentários

  1. Closed the laptop and walked away thinking about the post for a good twenty minutes, and a stop at findyournextstrategicmove produced similar lingering thoughts, content that survives the closing of the browser tab is content that has actually entered the mind rather than just decorating the screen for the duration of the reading.

  2. Worth saying that this is one of the better things I have read on the topic in months, and a stop at windharborartisanexchange reinforced that ranking, the topic is well covered by many sources but few do it with this level of care and the few that do deserve to be flagged so other readers can find them.

  3. Arkadaşlar merhaba uzun zamandır takipteyim. Kapanan sitelerden bıktım resmen vallahi. Detaylı güncellemeleri kontrol edip süreci sorunsuz başlattım. En sonunda güvenilir bir kaynak buldum ve size de aktarayım dedim: 1xbet spor bahislerinin adresi 1xbet spor bahislerinin adresi. Ne diyeyim yani anlatayım mı — bahis olsun casino olsun her şey düşünülmüş resmen.

    bonusları bile tatmin edici gerçekten inanın. Araştırmayı seven biriyimdir bu konuda — en memnun kaldığım yer burası oldu kesinlikle. Umarım işinize yarar bu bilgiler…

  4. Decided to set a calendar reminder to revisit, and a stop at novalog extended that revisit list, calendar entries for content are a level of commitment I rarely make but when I do they signal a higher regard than a simple bookmark and this site has earned that calendar tier of relationship from me today.

  5. Without comparing too aggressively to other sources this one stands out for the right reasons, and a look at bravopier continued that distinctive quality, content that distinguishes itself through substance rather than style tricks is content with lasting differentiation and this site has clearly chosen substance based differentiation as its core editorial strategy.

  6. Now sitting with the thoughts the post triggered rather than rushing on to the next thing, and a stop at bravopier extended that reflective pause, content that earns time for thought after closing the tab is content of higher value than the merely interesting and this site has clearly produced that lasting effect today.

  7. Reading this in my last reading slot of the day was a good way to end, and a stop at foxarbor provided a satisfying close to the reading session, content that ends a day well rather than agitating it before sleep is the kind I value increasingly and this site fits that role for me consistently now.

  8. Appreciate that you did not pad this with fluff to hit a word count, the post says what it needs to say and stops, and a look at musebeat did the same, brevity here feels intentional not lazy which is a distinction many writers miss completely sometimes when they are working under deadlines.

  9. Now noticing that the post never raised its voice even when making a strong point, and a look at edgedial continued that calm volume, content that can make important points without resorting to typographic emphasis or emotional appeal is content that trusts its substance to do the work and this site has that confidence consistently.

  10. Reading the writers other posts after this one suggests the quality is consistent rather than peak, and a stop at woodcoveartisanexchange confirmed the consistent quality reading, sites that hold the same level across many pieces rather than peaking on a few are sites with sustainable editorial discipline and this one has clearly developed that.

  11. Reading this slowly to give it the attention it deserved, and a stop at etherledges earned the same slow read, choosing to read slowly is a small act of respect for content quality and very few sites earn that respect from me but this one did so without any explicit ask which is the cleanest way.

Deixe um comentário

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