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.

8.895 Comentários

  1. Now noticing the careful balance the post struck between confidence and humility, and a stop at firmessence maintained the same balance, finding the line between asserting and admitting is hard and this site has clearly developed the calibration to walk that line consistently which produces a more persuasive reading experience for me.

  2. Beyond the immediate post itself the editorial sensibility behind the site is what struck me, and a stop at softsummerfields continued displaying that sensibility, content that reveals editorial choices through accumulated reading is content with structural quality and this site has clearly developed an underlying approach worth identifying through multiple sessions of reading.

  3. Now sitting with the thoughts the post triggered rather than rushing on to the next thing, and a stop at peacelandworld extended that reflective pause, content that earns time for thought after closing the tab is content of higher value than the merely interesting and this site has clearly produced that lasting effect today.

  4. Worth saying that the quiet confidence of the writing is what landed first, and a look at epicinlets continued that quiet quality, confident writing without the loud display of confidence is a rare combination and this site has clearly developed both the knowledge and the editorial restraint to land that combination consistently.

  5. Definitely a recommend from me, anyone curious about the topic should check this out, and a look at epicinlets adds even more reason for that, the depth and quality combine to make this site one I will be pointing people toward whenever similar conversations come up over the months ahead at work or socially.

  6. Decided not to comment because the post said what needed saying, and a stop at lakequill continued that complete feel, content that does not invite obvious additions or corrections from readers is content that has been carefully considered and this site appears to consistently produce pieces that satisfy rather than provoke unnecessary follow ups.

  7. Stands apart from similar pages by actually being useful, that is high praise these days, and a look at brightnorthboutique kept that standard going, you can tell when a site is built around the reader versus around metrics and this one clearly belongs to the first category for sure based on what I read.

  8. Appreciated that the writer trusted the reader to follow along without constant restating of earlier points, and a look at brightnorthboutique continued that respect for the reader, treating an audience as capable adults rather than as people to be hand held through every paragraph is something I notice and value highly across the open internet today.

  9. Considered against the flood of similar content this one stands apart in important ways, and a stop at softmountainmart extended that distinctive feel, sites that find their own corner of a crowded topic and stay there are sites worth following and this one has clearly carved out its own space and committed to defending it carefully.

  10. Reading this in a quiet hour and finding it suited the quiet, and a stop at irisarbors extended the quiet reading mood, content that matches its own optimal reading conditions rather than fighting them is content that has been thoughtfully calibrated and this site reads as having a particular reading mood in mind throughout.

  11. Reading this on a long flight and finding it the best thing I read across hours of trying, and a stop at irisarbors kept the streak going, when content beats long flight reading you know it has substance because flight reading is a hard test of a piece given the alternatives available everywhere.

  12. Liked the way the post handled the final paragraph, no neat bow but no abrupt cutoff either, and a stop at wildtimbercollective continued that thoughtful ending pattern, endings are hard and most blog writers either over engineer them or skip them entirely and this site has clearly figured out a sustainable middle approach.

  13. The overall feel of the post was professional without being stuffy, and a look at isleparishs kept that approachable expertise going, finding the right register for technical content is hard but this site has clearly figured out how to sound knowledgeable without slipping into that distant lecturing tone that loses readers in droves every time.

  14. Now planning to share the link with a small group of readers I trust, and a look at naturallycraftedgoodsmarket 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.

  15. Now appreciating that the post did not require external context to follow, and a look at isleparishs maintained the same self contained quality, content that respects new visitors by being readable without prerequisites is content with broader accessibility and this site has clearly invested in keeping each piece reader friendly for fresh arrivals.

  16. Reading this with a fresh mind in the morning brought out details I might have missed in the afternoon, and a stop at lacecabins earned the same fresh attention, content that rewards being read at full attention rather than at energy lows is content with real density and this site has that density consistently.

  17. Felt like I was reading something written by someone who actually thinks about the topic rather than reciting it, and a look at driftfairs reinforced that impression, the difference between recited content and considered content is huge and this site clearly belongs to the latter category which I appreciate as a careful reader looking for substance.

  18. A relief to read something where I did not have to fact check every claim mentally, and a look at ct2020highschoolgrads continued that reliable feeling, sites where I can lower my guard and trust the content are rare and this one is earning that trust paragraph by paragraph through consistent careful work behind the scenes.

  19. After reading several posts back to back the consistent voice across them is impressive, and a stop at pacecabin continued that voice consistency, sites that maintain a single coherent voice across many pieces by potentially many writers represent serious editorial discipline and this one has clearly developed the institutional consistency needed for that.

  20. Solid value packed into a relatively short post, that takes skill, and a look at portmills continues the dense useful content across more pages, this site clearly understands that respecting reader time is itself a form of generosity which is something most blog operations seem to have forgotten lately across the wider open web.

  21. Solid little post, the kind that does not need to be flashy because the substance is doing the work, and a look at robinshuteracing kept that quiet confidence going across the site, this is what writing looks like when the writer trusts the content to land on its own without theatrics or unnecessary attention seeking behaviour.

  22. During a quiet evening reading session this provided just the right depth without being heavy, and a stop at ct2020highschoolgrads maintained the same evening appropriate weight, content with depth that does not exhaust the reader is content with editorial calibration and this site has clearly figured out how to be substantial without being demanding all the time.

  23. After reading several posts back to back the consistent voice across them is impressive, and a stop at pacecabin continued that voice consistency, sites that maintain a single coherent voice across many pieces by potentially many writers represent serious editorial discipline and this one has clearly developed the institutional consistency needed for that.

  24. Most blog writing on this subject reaches for the same handful of arguments and this post avoided them, and a look at firminlets continued the original treatment, content that finds its own path through territory other writers have flattened is content with real authorial energy and this site has plenty of that distinctive energy.

  25. Worth saying that this is one of the better things I have read on the topic in months, and a stop at premiumethicalgoods reinforced that ranking, the topic is well covered by many sources but few do it with this level of care and the few that do deserve to be flagged so other readers can find them.

  26. Honestly informative, the writer covers the ground without showing off, and a look at firminlets reflected the same humility, content that respects the reader rather than trying to dazzle them is something I always appreciate and rarely come across in this corner of the internet today across the topics I usually read.

  27. Now adjusting my expectations upward for the topic based on this post, and a stop at hazemills continued that bar raising effect, content that resets what I think is possible on a subject is doing real work in shaping my standards and this site is providing those bar raising experiences at a notable rate during sessions.

  28. Working through this site has been a small antidote to the shallow content that fills most of my reading time, and a stop at pacecabins 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.

  29. freshcollectionhub freshcollectionhub

    A nicely understated post that does not shout for attention, and a look at freshcollectionhub maintained the same quiet quality, understatement is a stylistic choice that distinguishes serious writing from attention seeking writing and this site has clearly committed to the understated approach as a core editorial value rather than just a phase.

  30. A genuine compliment to the writer for keeping the post focused on what mattered, and a look at pactcliff 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.

  31. Now feeling mildly impressed in a way I do not quite remember feeling about a blog in a while, and a stop at thedemocracyroadshow extended that mild impression, content that produces specific positive emotional responses rather than just neutral information transfer is content with extra dimensions and this site has those extra dimensions clearly.

  32. Now wishing I had found this site sooner, and a look at lobbydawn extended that mild regret, the calculation of how many years of good content I missed by not finding the right sources earlier is one I try not to make too often but it does come up sometimes when I find sites this good.

  33. If a friend asked me where to read carefully on the topic I would send them here without hesitation, and a look at mintdawns confirmed the recommendation strength, the directness of my recommendation reflects how confident I am in the quality and this site has earned undiluted recommendations from me across multiple recent conversations actually.

  34. Now recognising the editorial wisdom of letting some questions remain open at the end, and a look at pactcliff continued that intellectual honesty, content that does not force closure on contested questions is content that respects the limits of knowledge and this site has clearly developed the maturity to know when to leave space.

  35. A piece that suggested careful editing without showing the marks of the editing, and a look at lobbydawn continued that invisible polish, the best editing disappears into the prose and this site reads as having been edited with skill that does not announce itself which is the highest compliment I can offer any blog content.

  36. Now planning a longer reading session for the archives, and a stop at charitiespt 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.

  37. Worth saying that the quiet confidence of the writing is what landed first, and a look at ethicaleverydaystyle continued that quiet quality, confident writing without the loud display of confidence is a rare combination and this site has clearly developed both the knowledge and the editorial restraint to land that combination consistently.

  38. Came away with some new perspectives I had not considered before, and after mintdawns those ideas felt more complete, the kind of content that stays with you a little while after reading rather than slipping out the moment you switch tabs and move on with your day to whatever comes next.

  39. Thanks for the clean writing, no broken sentences and no awkward translations like some other sites have, and a quick stop at globebeat kept that polish going nicely, it really does make a difference when a reader can move through a page without tripping on every line or going back to reread.

  40. Felt this in a way I cannot quite explain, the topic just hit different here, and a stop at edenfairs 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.

  41. During the time spent here I noticed the absence of the usual distractions, and a stop at charitiespt 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.

  42. Generally I find the content on similar topics frustrating in specific ways and this post avoided all of them, and a look at globebeat 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.

  43. Bookmark added without hesitation after finishing, and a look at jadenurrea confirmed I should bookmark the homepage too rather than just this page, the rare site that earns category level trust rather than just single article approval is the kind I want to rely on across many different topics over time.

  44. Found this really helpful, the explanations are simple but they actually answer the questions a normal reader would have, and after I followed brightgrovehub I had a clearer sense of the topic, no extra fluff just useful points laid out in a sensible order that made the time worth it.

  45. If I had encountered this site five years ago I would have been telling everyone about it, and a look at larkcliffs extended that retrospective enthusiasm, the version of me who used to recommend favourite blogs frequently would have made sure friends knew about this one and that earlier enthusiasm is partially returning to me here.

  46. CharlesPab CharlesPab

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

  47. The post is absolutely great! Lots of great info and inspiration, both of which we all need! Also like to admire the time and effort you put into your blog and detailed information you offer! I will bookmark your website!

Deixe um comentário

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