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.

7.138 Comentários

  1. Reading this prompted me to subscribe to my first newsletter in months, and a stop at rankmotion confirmed the subscribe was the right call, content that earns a newsletter signup is content that has cleared a higher trust bar than a casual visit and this site has clearly earned that level of commitment from me.

  2. Really appreciate that the writer did not stretch the post to hit some target word count, the points end when they are made, and a stop at rankmotion reflected the same discipline, brevity is generosity in disguise and this site has clearly figured that out far better than most blog operations have.

  3. The post made the topic feel approachable without making it feel trivial, that is a fine balance, and a stop at linkcipher maintained the same balance, finding the middle ground between welcoming and serious is genuinely difficult and the writers here have clearly figured out how to consistently hit it well across many different posts.

  4. opalmeadowgoodsgallery opalmeadowgoodsgallery

    One of the more thoughtful posts I have read recently on this topic, and a stop at opalmeadowgoodsgallery added even more weight to that impression, this is genuinely good content that holds its own against far better known sites in the same space without trying to imitate any of them at all which I appreciate.

  5. seolane seolane

    Picked this for my morning read because the topic seemed worth the time, and a look at seolane confirmed the choice was right, my morning reading slot is precious and giving it to this site felt like a good investment rather than a waste which is a higher endorsement than I usually offer for content.

  6. My friends would appreciate a few of these posts and I will be sending links accordingly, and a look at rankmotive added more pages to my share queue, content that earns shares to specific people in specific contexts is content with social utility and this site is generating those targeted shares from me consistently lately.

  7. During a reading session that included several other sources this one stood out, and a look at adpivot continued the standout quality, the side by side comparison of sources during research is a useful exercise and this site has been winning those comparisons for me consistently across multiple research sessions during the last week.

  8. A clear cut above the usual noise on the subject, and a look at leadstrike only made that gap wider in my view, the kind of place that earns its visitors through quality rather than through aggressive marketing or sponsored placements which is increasingly the only way most sites stay afloat across the modern web.

  9. A piece that reads as if the writer trusted readers to fill in obvious gaps, and a look at thebestcorner 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.

  10. Reading this in a quiet coffee shop matched the calm energy of the writing, and a stop at linktactic extended that environmental match, content that has its own ambient quality which can match or clash with surroundings is content with a personality and this site has the kind of personality that suits calm reading.

  11. Worth marking this site as one to come back to deliberately rather than by accident, and a stop at linkvertex reinforced that intention, the difference between sites I find again by chance and sites I return to on purpose is meaningful and this one has clearly moved into the deliberate return category for me.

  12. shopbasemarket shopbasemarket

    Now adding the homepage to my regular check rotation rather than waiting for individual links to find me, and a stop at shopbasemarket 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.

  13. lemonlarkvendorparlor lemonlarkvendorparlor

    Worth recognising that this site does not chase the daily news cycle, and a stop at lemonlarkvendorparlor confirmed the longer publication arc, sites that resist the pressure to comment on every passing event are sites with genuine editorial discipline and this one has clearly chosen depth over volume which I respect deeply.

  14. A particular pleasure to read this with a fresh coffee, and a look at rankpush extended the pleasure across more pages, content that pairs well with quiet morning rituals is something I have come to value highly and this site has the kind of energy that fits naturally into a calm reading routine.

  15. Granted I am giving this site more credit than I usually give new finds, and a look at leadpoint continued earning that credit, the calibration of how much trust to extend after limited exposure is something I do carefully and this site has earned more trust on shorter exposure than most due to consistent quality across.

  16. A piece that reads as if the writer trusted readers to fill in obvious gaps, and a look at leadhatch 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.

  17. royaldealzone royaldealzone

    Came across this through a roundabout path and now it is on my regular rotation, and a stop at royaldealzone 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.

  18. Comfortable read, finished it without realising how much time had passed, and a look at ranklane pulled me into more pages the same way, the absence of friction in good content lets time disappear and that is one of the highest compliments I can pay any piece of writing I find online during a regular search session.

  19. Hey there! Someone in my Myspace group shared this website with us so I came
    to give it a look. I’m definitely loving the information. I’m book-marking and will be tweeting this to my followers!
    Superb blog and wonderful design and style.

  20. royaldealzone royaldealzone

    Came across this through a roundabout path and now it is on my regular rotation, and a stop at royaldealzone 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.

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

  22. Worth recognising that the post did not pretend to be the final word on the topic, and a stop at rankchart continued that humility, content that admits its own scope and limits is more trustworthy than content that overreaches and this site has clearly developed the editorial maturity to know what it can and cannot claim well.

  23. The tone stayed consistent across the whole post which is harder than it looks for longer pieces, and a look at findsomethingunique continued the same voice, this kind of editorial consistency is a sign of either a single careful writer or a tightly run team and either is impressive today across the broader media environment.

  24. Picked this up between two other things I was doing and got drawn in completely, and after linkimpact my original tasks were completely forgotten for a while, content that derails a workflow in a positive way by being more interesting than what you were already doing is rare and worth recognising clearly.

  25. swiftmaplecorner swiftmaplecorner

    I usually skim posts like these but this one held my attention all the way through, and a stop at swiftmaplecorner did the same, that is a strong endorsement coming from me because I am usually quick to bounce when content gets repetitive or fails to deliver on its initial promise made in the headline.

  26. Now recognising that this site has earned a place in the small group of resources I treat as authoritative, and a stop at expandyourmind 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.

  27. Bookmark earned, share earned, return visit earned, all from one reading session, and a look at leadslate did the same, the trifecta of bookmark and share and return is rare in a single visit and represents the highest level of engagement I tend to offer any piece of online content these days here.

  28. twilightcovecollective twilightcovecollective

    Worth a quiet moment of recognition for the consistency I have noticed across multiple posts, and a stop at twilightcovecollective continued that consistent quality, sites that maintain quality across many pieces rather than peaking on one viral post are sites with real editorial discipline and this one has clearly developed that discipline carefully.

  29. modernoutfitstore modernoutfitstore

    During a reading session that included several other sources this one stood out, and a look at modernoutfitstore continued the standout quality, the side by side comparison of sources during research is a useful exercise and this site has been winning those comparisons for me consistently across multiple research sessions during the last week.

  30. Honestly the simplicity of the explanation made the topic click for me in a way other writeups had not, and a look at seovibe continued that clarity into related areas, when a writer gets the level of explanation right the reader does the heavy lifting themselves and the post just enables it.

  31. Looking for similar voices elsewhere has come up empty in my recent searches, and a stop at rankrally extended the search frustration, the rare site that does what no other does in quite the same way is precious and this one has clearly developed a particular approach that I have not been able to find duplicates of.

  32. modernoutfitstore modernoutfitstore

    Bookmark added in three places to make sure I do not lose the link, and a look at modernoutfitstore got the same redundant treatment, sites I am afraid to lose are the rare keepers and this is clearly one of them based on what I have read so far across this and a couple of related posts.

  33. radiantmaplestore radiantmaplestore

    Worth flagging that the writing rewarded a second read more than I expected, and a look at radiantmaplestore produced the same second read benefit, content with hidden depths that emerge only on careful rereading is rare in the modern blog space and this site has clearly invested in that level of compositional density throughout.

  34. Looking back on this reading session it stands as one of the better ones recently, and a look at linkgrit extended that ranking, the informal ranking of reading sessions against each other is something I do mentally and this session ranks high largely because of this site and a couple of related pages here.

  35. Felt the post had been written without using a single buzzword, and a look at rankfunnel continued that clean vocabulary, content free of jargon and trendy phrases reads better and ages better and this site has clearly committed to a vocabulary that will not feel dated in three years which is impressive editorially.

  36. Appreciate the work that went into laying this out so clearly, every section earns its place without filler, and a look at leadspot confirmed the same care, definitely the kind of place that deserves a return visit when the topic comes up again later in the future or for any related question.

  37. Liked the careful selection of which details to include and which to skip, and a stop at adladder 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.

  38. AllanOxync AllanOxync

    Круглосуточный режим работы в клинике «Северный Вектор» обусловлен спецификой течения зависимостей, при которых ухудшение состояния может происходить внезапно. Наркологическая клиника в Ростове-на-Дону обеспечивает постоянную готовность медицинского персонала к приёму пациентов, что позволяет сократить время между возникновением симптомов и началом лечения. Такой подход снижает риск осложнений и повышает клиническую безопасность.
    Получить больше информации – наркологическая клиника цены в ростове-на-дону

  39. Reading this gave me a small framework I expect to use going forward, and a stop at startyourjourneytoday extended that framework, content that produces transferable mental models rather than just specific facts is content with multiplicative value and this site is providing those models at a rate that justifies extra attention from me regularly.

  40. twilightcreststore twilightcreststore

    Now appreciating that the post left me with enough to say in a follow up conversation, and a look at twilightcreststore added more material for those follow ups, content that prepares me for related conversations rather than just informing me alone is content with social utility and this site provides that social armament reliably for me.

  41. buypathmarket buypathmarket

    Took the time to read the comments on this post too and they were also worth reading, and a stop at buypathmarket suggested the community quality matches the content quality, when the conversation around a piece is as good as the piece itself you know you have found a real corner of the internet.

  42. Thanks for a post that does not try to be funny when it is not the moment for it, and a stop at seochart maintained the same appropriate seriousness, knowing when humour helps and when it just signals desperation for engagement is a sign of editorial maturity that many blogs have not developed yet.

  43. digitalcartcenter digitalcartcenter

    Decided not to skim despite my usual habit and was rewarded for the discipline, and a stop at digitalcartcenter earned the same patient approach, training myself to recognise sites that warrant slower reading is part of being a careful online reader and this site is the kind that helps me practice that skill regularly.

  44. With havin so much content and articles do you ever run into any issues of plagorism or
    copyright violation? My blog has a lot of unique content I’ve either authored myself or outsourced but it seems a lot of it is popping it up all
    over the internet without my authorization. Do you
    know any methods to help protect against content from being stolen? I’d definitely appreciate it.

  45. Reading this confirmed a small detail I had been uncertain about, and a stop at rankcrest provided the source for further checking, content that supports verification through citations or links rather than just asserting facts is more trustworthy and this site has clearly built its credibility through that kind of verifiable approach consistently.

  46. The use of plain language without dumbing down the topic was really well done, and a look at seohatch continued in that same accessible style, this is something many technical writers fail at because they either confuse their readers or condescend to them but here neither problem appears at all which is impressive really.

Deixe um comentário

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