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.

6.374 Comentários

  1. Nice and clean, that is the best way to describe the writing here, no clutter and no wasted words, and a quick visit to longledge kept that going, I appreciate when a site treats its readers like people who can think for themselves without needing constant hand holding through every paragraph.

  2. Liked that there was nothing performative about the writing, and a stop at ideamapper 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.

  3. Honest reaction is that I want to send this to a friend who would benefit from it, and a look at duneelfin added more material I will pass along too, the impulse to share is the strongest signal I have for content quality and this site is generating that impulse cleanly across multiple posts.

  4. Now thinking I want more sites built on this kind of editorial foundation, and a stop at forwardthinkingpath extended that wish into a broader hope, sites built on substance and care rather than on metrics and growth are the kind of sites I want to see more of and this one is a small example worth supporting.

  5. Denemek isteyen arkadaşlara hep soruyorum. Güvenilir bir site bulmak gerçekten çok zaman aldı. Sonunda tüm teknik detayları inceleyip sistemi test ettim. En sonunda doğru adrese ulaştım ve size de tüm detayları aktarmak istedim, güncel bilgilere buradan bakabilirsiniz: 1xbet üye ol 1xbet üye ol. Valla bak net söyleyeyim — casino oyunlarına meraklıysanız burası tam size göre.

    müşteri hizmetleri bile ilgili ve hızlı. İşin doğrusunu söylemek gerekirse — başka yerde vakit kaybetmeyin yani. Umarım siz de memnun kalırsınız…

  6. A piece that reads as if the writer trusted readers to fill in obvious gaps, and a look at chimneycargo continued that respectful approach, content that does not over explain what the reader can infer is content that respects intelligence and this site has clearly chosen to write to capable readers rather than to the lowest common denominator.

  7. Glad the writer did not feel the need to argue with imaginary critics in the post itself, and a stop at actionblueprint kept the same focused approach going, defensive writing wastes the reader time and confidence on positions that did not need defending and this post has clearly avoided that common failure.

  8. Worth marking the moment when reading this clicked into something useful for my own work, and a look at bisonfudge extended that practical click, content that connects to my actual life rather than just being interesting is content with the highest kind of value and this site is generating that connection at a high rate.

  9. Great work on keeping things readable, the post never drags or repeats itself which I really appreciate, and a stop at strategymap added a bit more context that fit naturally with what was already said here, no need to read everything twice to get the point being made today.

  10. Now feeling the quiet pleasure of finding writing that takes itself seriously without being self serious, and a stop at momentumcoordination 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.

  11. Liked the careful selection of which details to include and which to skip, and a stop at builddirectionfirst reflected the same editorial judgement, knowing what to leave out is just as important as knowing what to include and this site has clearly figured out where that line sits for the topics it covers regularly.

  12. Goodinidat Goodinidat

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

  13. Felt the post was written for someone like me without explicitly addressing me, and a look at chimneycargo 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.

  14. Picked something concrete from the post that I will use immediately, and a look at actionblueprint added another concrete piece, content that produces immediately useful output rather than just abstract appreciation is content that earns its place in my regular rotation without needing any further evaluation from me at this point honestly.

  15. Different in a good way from the cookie cutter content that fills most blogs covering this area, and a stop at ivoryharborvendorparlor kept showing me why, original thoughtful writing exists if you know where to look and this site has earned a place on my short list of those rare exceptions worth defending.

  16. Came across this through a roundabout path and now it is on my regular rotation, and a stop at nextstepnavigator sealed that decision, the open web still produces serendipitous discoveries when you let the citations and references guide you rather than relying purely on algorithmic feeds for new content recommendations always.

  17. Telefonuma güncel sürümü yüklemek istiyordum açıkçası. Herkes farklı bir şey tavsiye ediyordu kime güveneceğimi bilemedim. Güncel bilgileri kontrol edip süreci hatasız başlattım. En sonunda sağlam bir kaynağa ulaştım ve size de tüm detayları aktarmak istedim, güncel bilgilere buradan bakabilirsiniz: 1xbet türkiye indir 1xbet türkiye indir. Valla bak net söyleyeyim — telefonuma indirdikten sonra çok rahat ettim.

    Hiçbir sıkıntı yaşamadım indirme aşamasında. İşin doğrusunu söylemek gerekirse — en kullanışlı uygulama bu oldu artık. Herkese hayırlı olsun…

  18. This filled in a gap in my understanding that I had not even noticed was there, and a stop at intentionalvector did the same, the kind of post that gives you more than you expected when you first clicked through from somewhere else, a real find for anyone curious about the area covered here.

  19. Time spent here today felt productive in the way that good reading sessions sometimes do, and a stop at nextstepnavigator extended that productive feeling across the rest of the morning, the difference between productive reading and merely passing time is real and this site is consistently on the productive side for me lately.

  20. Reading this prompted me to dig into a related topic later, and a stop at aviaryelder provided some of the starting points for that follow up reading, content that triggers further exploration rather than satisfying curiosity completely is content with real generative energy and this site has plenty of that energy throughout it.

  21. Felt no urge to argue with the conclusions even though I started the post slightly skeptical, and a look at eagleelder maintained that pattern, writing that earns agreement through clarity of argument rather than rhetorical pressure is the kind I find most persuasive and the kind I want to read more of these days.

  22. Now adding the homepage to my regular check rotation rather than waiting for individual links to find me, and a stop at bisonholly confirmed the rotation upgrade, the move from passive discovery to active checking is a vote of confidence in a sites ongoing quality and this site has earned that active engagement clearly.

Deixe um comentário

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