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.711 Comentários

  1. The pacing of the post was just right, never rushed and never dragged out unnecessarily, and a look at pyxedge 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.

  2. Found a small mental shift after reading this, the framing here is just a bit different from the standard takes online, and a look at cobqix extended that fresh perspective across more material, the rare site whose voice actually changes how you think about something rather than just confirming existing beliefs.

  3. Now planning to share the link with a small group of readers I trust, and a look at intentionalclickpingexperience suggested more material to share with the same group, recommending content into a curated circle requires confidence in the recommendation and this site is making me confident in those personal recommendations on multiple separate occasions now.

  4. Just nice to read something that does not feel like it was assembled from a content brief, and a stop at explorefreshthinking kept that handcrafted feel going, you can tell when a real human with real understanding is behind the words versus a templated piece churned out for an algorithm to find.

  5. Felt this in a way I cannot quite explain, the topic just hit different here, and a stop at findyournextmove continued in that vein, sometimes you find a site whose perspective lines up with how you have been thinking and reading their work feels like a small relief which I appreciated more than I expected.

  6. Thanks for not padding this with the usual filler intros and outros that every other blog seems to require, and a quick visit to oldenneon continued that lean approach across more posts, content stripped of waste is content that respects you and I will always come back to that kind of approach.

  7. Started thinking about my own writing differently after reading, and a look at intentionalclickpingexperience 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.

  8. Got pulled in by the headline and stayed because the content actually delivered on the promise, and a stop at explorefreshthinking kept that trust intact, when a site lives up to its own framing it earns the right to keep showing up in my browser tabs going forward indefinitely from here on out really.

  9. Felt the post was written for someone like me without explicitly addressing me, and a look at learnandoptimize produced the same fit, when content lands on its target without pandering you know the writer has done careful audience thinking rather than relying on demographic targeting or interest signals to do the work of editorial decisions.

  10. Robertrox Robertrox

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

  11. Started reading skeptically because the headline seemed overconfident, and the post earned the headline by the end, and a look at unionstaff continued that pattern of earning its claims, sites that can back up their headlines without overpromising are rare and this one has clearly developed editorial calibration on that front consistently.

Deixe um comentário

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