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

  1. Now noticing that the post avoided the temptation to be funny in places where humour would have undermined the substance, and a stop at solarorchardmarketparlor maintained the same restraint, knowing when to be serious is a rare editorial virtue and this site has clearly developed it through what I assume is careful editorial practice over years.

  2. Picked something concrete from the post that I will use immediately, and a look at buildstrongmomentum 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.

  3. Now noticing that the post never raised its voice even when making a strong point, and a look at learnandaccelerategrowth continued that calm volume, content that can make important points without resorting to typographic emphasis or emotional appeal is content that trusts its substance to do the work and this site has that confidence consistently.

  4. 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 createimpactstructure I am sure this site treats its readers well, no flashy tricks just useful content done right which is honestly all I want online.

  5. A particular kind of restraint shows up in the writing, and a look at buildstrongmomentum 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.

  6. Good clean post, no errors and no awkward phrasing that breaks the reading flow, and a stop at createimpactstructure kept the same standard, definitely the kind of editorial care that earns a return visit because it tells me the writer is paying attention to details that matter to readers rather than just rushing publication.

  7. I like what you guys are up too. This sort of clever work and reporting!
    Keep up the excellent works guys I’ve incorporated you
    guys to blogroll.

  8. Appreciate how nothing here feels copied or pieced together from other places, the voice is consistent and the tone stays human, and after I checked hupbolt I noticed the same style holds, which is a small detail but it makes the whole experience feel personal rather than like another generic site.

  9. A thoughtful piece that did not strain to be thoughtful, and a look at exploreinnovativepaths continued that effortless quality, when thinking shows up in writing without the writer drawing attention to it you know you are reading something genuinely considered rather than something performing the appearance of consideration which is also common online.

  10. Reading this back to back with a similar piece elsewhere made the quality difference obvious, and a stop at holbook only widened the gap, comparing content side by side is a useful exercise and the gap between this site and average competitors in the space is large enough to be noticeable from the first paragraph.

  11. Worth your time, that is the simplest endorsement I can give, and a stop at growyourpotential extends that endorsement across the rest of the site, this is one of those increasingly rare places that delivers on what it promises rather than over selling the content and under delivering on substance every time which I find frustrating elsewhere.

  12. Top tier post, the kind that makes you want to share the link with friends working in the same area, and a stop at bomkix only made me more confident in doing that, this site is one of the better resources I have seen on the topic recently across both new and older posts.

  13. Learned something from this without having to dig through layers of fluff, and a stop at learnandinnovate added a bit more context that helped tie things together for me, definitely a useful corner of the internet for anyone who wants real information without the usual marketing nonsense around it that often ruins similar pages.

  14. Solid stuff, the kind of post that I will probably refer back to later this month when the topic comes up again, and a look at discoverhiddeninsights only confirmed I should bookmark the site as a whole rather than just this single page for future reference and use across coming weeks.

  15. A piece that read as the work of someone who reads carefully themselves, and a look at buildintentionalgrowth continued that informed feel, writers who are also serious readers produce work with a different quality and this site reads as the product of someone steeped in good writing rather than just generating content for an audience.

  16. Reading this prompted a small redirection in something I was working on, and a stop at holbook extended that redirecting influence, content that affects my actual work rather than just my thinking has the highest practical impact and this site is providing that level of influence for me at a sustainable rate apparently.

  17. A piece that did not lecture even when it had clear positions, and a look at learnandinnovate maintained the same teaching without preaching tone, finding the line between informing and lecturing is hard and most sites land on the wrong side of it but this one has clearly figured out how to inform without becoming preachy.

  18. Reading this in the morning set a good tone for the day, and a quick visit to findclearopportunities kept that good tone going, content can do that sometimes when it hits the right notes and finding sites that consistently strike that tone is something I have learned to recognise and reward with regular visits.

  19. Just wanted to drop a quick note saying this was a useful read on a topic I have been circling, no fluff, and a stop at growwithsteadyfocus added a few extra points that fit the same simple style which makes the whole site feel coherent rather than thrown together by many different writers with different goals.

  20. Now setting aside time on my next free afternoon to read more from the archives, and a stop at discoverinnovativeideas confirmed that time will be well spent, the rare site whose archive deserves a dedicated reading session rather than just casual sampling is the kind of resource worth scheduling around and this one qualifies clearly.

  21. A piece that handled a controversial angle without becoming heated, and a look at growwithfocusedsteps continued that calm engagement, content that can address contested topics without inflaming them is doing rare diplomatic work and this site has clearly developed the editorial maturity to handle sensitive material with the appropriate temperature of writing throughout.

  22. Really thankful for posts that respect a reader’s time, this one does, and a quick look at buildstrategicdirection was the same, no need to scroll through endless intros just to get to the actual content, that approach alone is enough reason to come back here regularly for the kind of writing offered.

  23. Now thinking about how this post will age over the coming years, and a stop at buildsmartmomentum suggested the same durability, content built to age well rather than to capture the attention of the moment is content with a different kind of value and this site has clearly chosen the long horizon over the short one.

  24. Found this really helpful, the explanations are simple but they actually answer the questions a normal reader would have, and after I followed buildfocusedmomentum 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.

  25. Now thinking about this site as a small example of what good independent writing looks like, and a stop at everydayvaluecorner continued that exemplary status, the few sites that serve as good examples are sites worth holding up in conversations about quality and this one has earned that exemplary placement through patient consistent effort over time.

  26. A small thank you note from me to the team behind this work, the post earned it, and a stop at startfreshtoday suggested more thanks would be in order over time, recognising the people who do good writing online is something I try to remember to do because the alternative is silence and silence rewards mediocrity unfortunately.

  27. Skipped breakfast still reading this and finished hungry but satisfied, and a stop at discovernewpotential kept me past breakfast time, content that displaces basic biological needs is content with serious attentional pull and the writers here are clearly capable of producing that level of engagement which is genuinely impressive these days.

  28. Worth recognising the specific care that went into how this post ended, and a look at growwithfocusedsteps maintained the same careful conclusions, endings are where most blog content falls apart and this site has clearly invested in the closing stretches of its pieces rather than letting them simply trail off when energy fades.

  29. Liked the post enough to read it twice and the second read found new things, and a stop at buildsmartmomentum similarly rewarded the second look, content with hidden depths that only reveal themselves on careful rereading is the rare kind that earns lasting respect rather than fleeting first impressions only briefly held.

  30. Looking at the surface design and the substance together this site has both right, and a look at discoverwinningpaths reinforced that integrated quality, sites where presentation and content reinforce each other rather than fighting are sites with full editorial coherence and this one has clearly invested in both layers in a balanced way.

  31. If I had to summarise the editorial sensibility of this site in a few words it would be careful and human, and a look at createclaritysteps extended that summary feeling, capturing the essence of a sites approach in brief is hard but this site has a clear enough identity that the summary comes naturally enough.

  32. Quality you can feel from the first paragraph, the writer clearly knows the topic and how to share it, and a quick look at scrolltower confirmed the same depth runs throughout the rest of the site as well which is rare and worth pointing out when it happens online for any reader passing through.

  33. Reading this prompted me to clean up some old notes related to the topic, and a stop at jebbeo extended that organising urge, content that triggers personal organisation rather than just consuming attention is content with motivating energy and this site has the kind of clarity that prompts active follow up rather than passive consumption.

  34. Took a screenshot of one section to come back to later, and a stop at createbetterresults 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.

  35. Approaching this site through a casual link click and being surprised by what I found, and a look at startthinkingstrategically extended the surprise, the rare experience of stumbling into excellent independent content rather than predictable mediocrity is one of the actual remaining pleasures of casual web browsing and this site provided it cleanly.

  36. Spent a few minutes here and came away with a clearer picture of the topic, the writing keeps things simple without dumbing them down, and after a stop at holcap the rest of the points lined up neatly which is something I appreciate when I am short on time and need answers fast.

  37. Picked this post to share in a Slack channel where I knew it would be appreciated, and a look at createbetterresults suggested I will share more from here later, content worth sharing into a professional context is content that has earned a higher kind of trust than mere personal interest and this site has it.

  38. During a quiet evening reading session this provided just the right depth without being heavy, and a stop at inaarch 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.

  39. Really thankful for posts that respect a reader’s time, this one does, and a quick look at hupido was the same, no need to scroll through endless intros just to get to the actual content, that approach alone is enough reason to come back here regularly for the kind of writing offered.

  40. Found this through a search that was generic enough I did not expect quality results, and a look at learnandoptimizefast continued the surprisingly good experience, search engines occasionally still surface excellent independent content if you scroll past the obvious paid and high authority results which is reassuring to remember sometimes.

  41. Nice and clean, that is the best way to describe the writing here, no clutter and no wasted words, and a quick visit to buildsmartprogress 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.

  42. If quality blog writing is dying as people sometimes claim then this site is one piece of evidence that it has not died yet, and a look at discovermeaningfulgrowth extended that evidence, the broader cultural question about online writing has empirical answers in specific sites and this one is contributing to a more optimistic answer overall.

  43. Just one of those reads that left me feeling slightly more capable rather than overwhelmed, and a look at learnandexpandfast kept that empowering feel going, the difference between content that builds the reader up and content that intimidates them is huge and this site clearly knows which side of that line to stand.

  44. A piece that left me thinking I had been undercaring about the topic, and a look at createimpacttogether reinforced that mild concern, content that raises the appropriate weight of a subject without being preachy about it is doing important work and this site is providing that gentle elevation of attention for me consistently.

  45. Just want to recognise that someone clearly cared about how this turned out, and a look at startwithclearvision confirmed that care extends across the broader site, you can feel the difference between content shipped to hit a deadline and content released because the writer was actually proud of the result for once.

Deixe um comentário

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