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

  1. Came back to this twice now in the same week which is unusual for me, and a look at learnandoptimizefast suggested I will keep coming back, the kind of post that earns repeated visits rather than one and done reading is the gold standard for content quality and this site clearly hit that standard.

  2. Recommended to anyone working in or curious about this area, the depth and clarity combine well, and a look at buildsmartprogress keeps that going across more pages, the kind of site that earns regular visits rather than chasing trends has my respect because it suggests genuine commitment to the topic itself rather than to chasing trends.

  3. Now recognising that this site has earned a place in the small group of resources I treat as authoritative, and a stop at inaarch confirmed that placement, the difference between resources I trust and resources I just consume is real and this site has clearly moved into the trusted category through consistent quality over time.

  4. Now I want to find more sites like this but I suspect they are rare, and a look at learnandexpandfast extended that thought, the few sites that meet this quality bar are precious specifically because they are rare and finding others like them is one of the ongoing projects of careful internet curation across the years.

  5. Good quality through and through, no rough edges and no signs of being rushed, and a quick look at createimpacttogether kept the same polish going, the kind of site that respects its own brand by maintaining consistency across pages which is something I always appreciate as a reader looking for trustworthy information online today.

  6. Honestly enjoyed every minute spent here, that is not something I say lightly, and a look at startwithclearvision 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.

  7. Now considering writing a longer note about the post somewhere, and a look at createfocusedaction added more material for that note, content that prompts me to write rather than just consume is content with generative energy and this site is producing that generative effect for me at a higher rate than most sources.

  8. Quality work here, the post reads cleanly and the points stay focused throughout, and a stop at findnewopportunityflows kept the standard high, you can tell the writer cares about the final result rather than just hitting publish for the sake of having something new on the page to feed the search engines.

  9. Felt the post had been written without looking over its shoulder, and a look at hupido continued that confident posture, content written for its own sake rather than against imagined critics has a different quality and this site reads as written from a place of confidence rather than defensive justification of every claim.

  10. Came in confused about the topic and left with a much firmer grasp on it, and after growwithconfidencenow I felt I could explain this to someone else without hesitation, that is the gold standard for any educational content and most sites simply fail to reach it ever which is unfortunate but true.

  11. Took a screenshot of one section to come back to later, and a stop at buildsmartfoundations prompted another saved tab, the urge to capture and revisit specific pieces of content is something I rarely feel but when I do it tells me the work is worth more than the average passing read for sure.

  12. Now placing this in the small category of sites whose updates I would actually want to know about, and a stop at buildactionableprogress confirmed that placement, the difference between sites I want to follow and sites I just consume from is real and this one has crossed into the active follow category from the casual consumption side.

  13. Honestly enjoyed every minute spent here, that is not something I say lightly, and a look at siloteapot 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.

  14. Came here from a search and stayed for the side links because they were that interesting, and a stop at createprogressmapping took me even further into the site, the kind of organic exploration that good content invites is something most sites kill through aggressive interlinking and pushy navigation choices rather than relying on quality.

  15. Thanks for putting in the work to make this approachable, plenty of sites cover the same ground but most do it badly, and a quick visit to createprogressframework confirmed this one stands apart, simple language and useful examples without anyone trying to sell me anything along the way which I really appreciated.

  16. Closed the laptop after this and let the ideas settle for a few hours, and a stop at buildstrategicdirection similarly rewarded reflective time, content that benefits from sitting with rather than racing past is the kind I want more of and the kind that this site appears to consistently produce week after week here.

  17. A well calibrated piece that knew its scope and stayed inside it, and a look at findnewopportunityflows maintained the same scope discipline, scope creep is one of the failure modes of long blog posts and this site has clearly invested in the editorial discipline to prevent it which shows up in tightly contained pieces.

  18. Working through this site has been a small antidote to the shallow content that fills most of my reading time, and a stop at findgrowthdirections extended that antidote function, sites that quietly improve the average quality of my reading by being themselves are sites worth supporting through return visits and recommendations consistently.

  19. More substantial than most of what I find searching for this topic online, and a stop at learnandoptimizeprocesses kept that quality consistent, this is one of those sites where the writing actually rewards careful reading rather than punishing the patient reader with empty filler stretched out across long paragraphs that say very little.

  20. Honest assessment is that this is one of the better short reads I have had this week, and a look at bakeboxshop reinforced that, the bar for short content is low because most of it sacrifices substance for brevity but this site manages both at once which is harder than it sounds for most writers attempting it.

  21. A slim post with substantial content per word, and a look at discoveropportunityzones maintained the same density, the content per word ratio is something I track informally and this site scores high on that ratio compared to most sources I read regularly which is a quiet indicator of careful editorial work behind the scenes.

  22. Now understanding why someone recommended this site to me a while back, and a stop at createyourstorytoday explained the recommendation, sometimes recommendations make sense only after experience and this site has finally clicked into place as the kind of resource I now understand was being recommended for sound editorial reasons by my friend.

  23. Picked up on several small touches that suggest a careful editor, and a look at findbetterapproaches suggested the same hand at work across the broader site, editorial consistency at a granular level is one of the strongest signs that an operation is serious rather than just hobbyist and this site reads as serious throughout.

  24. A particular kind of restraint shows up in the writing, and a look at learnandoptimizeprocesses maintained the same restraint across pages, knowing what not to say is just as important as knowing what to say and this site has clearly developed strong instincts on both sides of that editorial line throughout pieces I have read.

  25. The lack of unnecessary jargon made the post accessible without sacrificing accuracy, and a look at createimpactquickly continued in the same accessible style, technical topics often hide behind specialised vocabulary but here the writer trusts the reader to keep up with plain language and that trust pays off nicely throughout the entire post.

  26. Worth flagging this site to a few specific friends who would appreciate the editorial sensibility, and a look at learnandrefine added more pages I will mention to them, recommending sites to specific people requires understanding both the site and the person and this site is making those personalised recommendations easy and natural for me.

  27. A piece that handled multiple complications without becoming confused, and a look at siloteapot continued that organisational clarity, holding multiple threads in a single piece without losing any of them is a sign of skilled writing and this site has clearly developed the editorial discipline to manage complexity without sacrificing readability throughout.

  28. My professional context would benefit from having this kind of resource available, and a look at createyourstorytoday 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.

  29. During the time spent here I noticed the absence of the usual distractions, and a stop at startwithpurposefulsteps extended that distraction free experience, content that does not fight my attention with pop ups and modals and aggressive prompts is content that respects me and this site has clearly chosen the respectful approach throughout.

  30. Liked everything about the experience, from the opening through to the closing notes, and a stop at inobrat extended that into more pages, finding a site where the editorial vision shows through every choice rather than feeling random is an increasingly rare experience and one I am glad to have today during this particular reading session.

  31. Decided to read this site for a while before forming a verdict, and the verdict after several pages is positive, and a stop at findbetterapproaches continued that pattern, judging a site requires more than one post and giving sites a fair sample is something I try to do for promising candidates rather than rushing to dismiss.

  32. Now planning a longer reading session for the archives, and a stop at buildactionableprogress confirmed the archives are worth that longer commitment, sites with archives I want to read deliberately rather than just sample are rare and this one has clearly earned that level of interest based on the consistency of what I have already read.

Deixe um comentário

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