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

  1. Decided to set a calendar reminder to revisit, and a stop at loudmark 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.

  2. Now appreciating that the post did not require me to agree with the writer to find it valuable, and a look at cloverharborvendorparlor maintained the same useful regardless of agreement quality, content that informs even when it does not convince is content with broader utility and this site reads as useful even when I disagree.

  3. Well done, the writing is professional without being stiff, and the topic is treated with care, and a look at ideaelevation reflected that approach, the kind of site I would point a colleague to if they asked for a reliable starting point on this topic in the future without any hesitation at all.

  4. ThomasAporo ThomasAporo

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

  5. Robertpom Robertpom

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

  6. Now appreciating the way the post avoided the temptation to be longer than necessary, and a look at actionbuildsresults continued that lean approach, content with the discipline to stop when finished rather than padding for length is content that respects both itself and its readers and this site has that disciplined editorial culture clearly throughout.

  7. A piece that ended with a clean landing rather than fading out, and a look at cloverhedge maintained the same crisp conclusions, endings that resolve rather than dissolve are a sign of careful structural thinking and this site has clearly invested in how its pieces conclude rather than letting them simply run out of energy.

  8. Thanks for putting this online without locking it behind email signups or paywalls, and a quick visit to borealberyl kept that open feel going, content that trusts the reader to come back rather than gating access is the kind of approach I will reward with regular return visits over time happily.

  9. Reading this triggered a small reorganisation of my own thinking on the topic, and a stop at forwardthinkingworks furthered that reorganisation, content that affects the shape of my mental model rather than just decorating it with new facts is content with structural rather than informational impact and this site provides that.

  10. Held my interest from the opening line through to the closing thought, and a stop at claritylane did the same, content that earns sustained attention in an environment full of distractions is doing something right and this site is clearly doing several things right rather than just one or two which I really appreciate.

  11. Clean writing, easy to read, and never tries too hard to impress, that combination is harder to find than people think, and after my time on cloverhedge I am sure this site treats its readers well, no flashy tricks just useful content done right which is honestly all I want online.

  12. A genuine compliment to the writer for keeping the post focused on what mattered, and a look at bagelcameo continued that disciplined focus, focus is a editorial choice that compounds across many small decisions and this site has clearly made those small decisions consistently across what I have read so far this week here.

  13. Most of the time I feel the open web is in decline and then I find a site like this, and a stop at momentumexecution reinforced that mood lift, the cumulative effect of finding occasional excellent independent content versus the cumulative effect of finding mostly mediocre content is real for the long term reader maintaining web habits today.

  14. Generally I find the content on similar topics frustrating in specific ways and this post avoided all of them, and a look at claritysystem continued that frustration free experience, content that sidesteps the standard failure modes of its genre is content with editorial awareness and this site has clearly studied what fails elsewhere consistently.

  15. Its such aas yyou read myy thoughts! Youu seem too know sso mych about this, likoe
    youu wrore thee eboook iin itt orr something. I think that youu
    just could ddo wioth soime perceent too power tthe message
    house a little bit, buut instead off that,this iss grat blog.
    A fantastic read. I’ll definitely bbe back.
    ofvd9wuaptihqc6qlc8e

  16. Michaelsed Michaelsed

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

  17. Stayed longer than planned because each section earned the next, and a look at focuspathway kept that pulling effect going across more pages, the kind of subtle pull that good writing exerts on attention is something I find harder and harder to resist when I encounter it on the open web today.

  18. Closed it feeling I had taken something away rather than just consumed something, and a stop at explorefreshstrategies extended that taking away feeling, the difference between content I extract value from and content I just pass through is something I track informally and this site is consistently in the value extraction column for me.

  19. Thanks for the readable length, I finished it without checking how much was left, and a stop at focusdesign kept me reading the same way, when I stop noticing the length of a piece because the content is engaging enough to sustain attention without willpower the writer has done their job well today.

  20. My time on this site has now extended past what I had budgeted, and a stop at dawnridgegoodsroom keeps extending it further, content that overstays its budget in my schedule is content that has earned the extra time and this site has been earning extra time across multiple visits to the point where my schedule needs adjustment.

  21. I came here looking for a quick answer and ended up reading the whole post because it was actually interesting, and after pearlcovemarketgallery I had a much fuller picture, no stress and no confusion just a clear walk through the topic that made everything fall into place without much effort.

  22. Skipped the TLDR thinking I would read everything anyway, and ended up enjoying the path through the full post, and a stop at flintanchor similarly rewarded the patient read, summaries are useful but the journey through good writing is part of what makes the destination feel earned rather than just delivered cleanly.

  23. Now feeling the small relief of finding writing that does not condescend, and a stop at gumboacorn extended that respect for readers, content that treats its audience as capable adults rather than as people to be managed produces a different reading experience and this site has clearly chosen the respectful approach across all pieces.

Deixe um comentário

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