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

  1. JamesGot JamesGot

    В этой статье мы говорим о важности поддержки в процессе выздоровления. Рассматриваются семьи, группы поддержки, специалисты и онлайн-ресурсы, которые могут сыграть решающую роль в избавлении от зависимости.
    А есть ли продолжение? – вывод из запоя на дому ростов

  2. AlvinHed AlvinHed

    В этой статье рассматриваются актуальные вопросы, связанные с развитием медицинской науки и её внедрением в повседневную практику. Особое внимание уделено вопросам профилактики, ранней диагностики и использованию технологий для улучшения здоровья человека.
    Углубиться в тему – частный медик 24 ростов на дону

  3. Worth observing that the post landed without needing a flashy headline to hook attention, and a stop at learnsomethingnewtoday did the same, content that earns engagement through substance rather than packaging is the kind I trust more deeply and this site has clearly chosen substance as the primary lever for reader engagement throughout.

  4. A piece that left me thinking I had been undercaring about the topic, and a look at smartshoppingzone 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.

  5. 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 makesomethingnew 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.

  6. Just nice to read something that does not feel like it was assembled from a content brief, and a stop at everydaystylemarket kept that handcrafted feel going, you can tell when a real human with real understanding is behind the words versus a templated piece churned out for an algorithm to find.

  7. Recommended without reservation for anyone interested in the topic at any level of expertise, and a look at yourpathforward only strengthens that recommendation, this site clearly knows how to serve readers across a range of backgrounds without watering down the content or talking past anyone in the audience which is genuinely impressive to see.

  8. Now feeling that this site is the kind I want to make sure does not disappear, and a look at dailytrendmarket reinforced that quiet protective feeling, the rare sites whose disappearance would actually matter to me are the sites I want to support through return visits and recommendations and this one has joined that small protected list.

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

  10. Good clean post, no errors and no awkward phrasing that breaks the reading flow, and a stop at shopandsaveonline 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.

  11. A piece that left me thinking I had been undercaring about the topic, and a look at exploreinnovativeideas 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.

  12. Liked that the post landed without needing to manufacture controversy or take a contrarian stance for attention, and a stop at ranknexus continued that grounded approach, content that earns attention through quality rather than provocation is the kind that builds long term trust rather than burning it on quick wins.

  13. A piece that demonstrated competence without performing it, and a look at dreambiggeralways maintained the same self assured but unshowy register, the gap between competence and performance of competence is one I track and this site has clearly chosen to demonstrate rather than perform which I find much more persuasive as a reader.

  14. Halfway through reading I knew this would be one to bookmark, and a look at rankorbit confirmed that early intuition, when bookmark intent forms before finishing a post you know the writing has cleared a quality bar that most content fails to clear and this site has cleared it on multiple visits already.

  15. Picked up a couple of new ideas here that I can actually try out, and after my visit to findyourpath I have even more notes saved, this is the kind of resource that pays you back for the time you spend on it which is rare to come across in this corner of the web.

  16. In the middle of an otherwise scattered day this post landed as a moment of focus, and a stop at trendandstyle extended that focused feeling across more pages, content that anchors a fragmented day rather than contributing to the fragmentation is content with real centring effect and this site is providing that anchoring function for me.

  17. Took a quick scan first and then went back to read properly because the post deserved it, and a stop at creativechoiceoutlet kept me reading carefully too, the kind of writing that earns a slower second pass rather than getting skimmed and forgotten is something I value highly when I happen to find it.

  18. Felt the writer was being honest with the reader which is rare enough that I want to acknowledge it, and a look at bestdailyoffers continued that honest feel, content built on actual knowledge rather than aggregated summaries is something I value highly and rarely come across in regular searches on the open internet these days.

  19. Reading this in my last reading slot of the day was a good way to end, and a stop at findyourpath provided a satisfying close to the reading session, content that ends a day well rather than agitating it before sleep is the kind I value increasingly and this site fits that role for me consistently now.

  20. Decided this was the kind of site I would defend in a discussion about good blog content, and a stop at linkbloom reinforced that, very few sites earn active defence rather than passive consumption and this one has clearly crossed that threshold for me without needing any explicit pitch from the writers themselves either.

  21. If I had encountered this site five years ago I would have been telling everyone about it, and a look at creativechoiceoutlet 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.

  22. Appreciated the way each section connected smoothly to the next without abrupt jumps, and a stop at everydaychoicehub kept that flow going nicely, transitions are something most blog writers ignore but the difference is huge for the reader who is trying to follow a sustained line of thought today across many different topics.

  23. Solid information that lines up with what I have been hearing from other reliable sources, and after my visit to packpeak I was even more certain of that, this site checks out which is something I value highly when so many places online play loose with the facts to chase a quick click.

  24. Reading this on the train into work was a better use of the commute than my usual choices, and a stop at mystylezone extended that commute reading well, content that improves transit time rather than just filling it is content with practical benefit and this site has earned its place in my morning commute reading rotation.

  25. Useful read, especially because the writer did not assume too much background from the reader, and a quick look at simplefashioncorner continued in the same way, a thoughtful site that meets people where they are which is something the modern web could use a lot more of for both casual and serious readers.

  26. Generally my comment to other readers about new sites is to wait and see but for this one I would jump to recommend now, and a look at packpeak reinforced that early recommendation, the speed at which a site earns my recommendation is itself a quality signal and this one has earned mine quickly clearly.

  27. Now feeling slightly more optimistic about the state of independent writing online, and a stop at rankripple extended that quiet optimism, sites like this one are the reason I have not given up on the open web entirely and finding them occasionally renews the case for paying attention to non algorithmic content sources today.

  28. Came in expecting another generic take and got something with actual character instead, and a look at discoveramazingfinds carried that personality forward, finding a distinct voice on a saturated topic is impressive and worth pointing out when it happens because most sites end up sounding identical to their nearest competitors quickly.

  29. A quiet piece that did not try to compete on volume, and a look at dailyshoppingzone maintained that selective approach, sites that publish less but better are increasingly rare in an environment that rewards volume and this one has clearly chosen quality cadence over quantity which is a brave editorial decision in current conditions.

  30. Bookmark added with a small mental note that this is a site to keep, and a look at linkboostly reinforced the keep status, the verb keep rather than visit captures something about how I think about this kind of site and it is a higher tier of relationship than I have with most places online today.

  31. Really liked the calm tone running through the post, no shouting and no urgency forced into the writing, and a look at findyourfavorites kept that quiet confidence going, the kind of voice that makes the reader feel respected rather than yelled at which is depressingly common across most modern blog content these days.

  32. Now recognising that the post handled the topic with appropriate technical precision without becoming dry, and a stop at growbeyondlimits continued that balance, technical precision and readability are often in tension and this site has clearly figured out how to maintain both at once which is one of the harder editorial achievements in the form.

  33. Started thinking about my own writing differently after reading, and a look at freshfashionmarket continued that reflective effect, content that influences how I work rather than just informing what I know is content with the highest kind of impact and this site has triggered some of that reflective influence today on me.

  34. My friends would appreciate a few of these posts and I will be sending links accordingly, and a look at dailychoicecorner 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.

  35. Now appreciating the small but real way this post improved my afternoon, and a stop at discoverinfiniteideas extended that small improvement effect, content that produces measurable positive impact on the texture of a reading day is content with real value and this site is producing those small positive impacts at a sustainable rate apparently.

  36. Now recognising the specific pleasure of reading writing that shows real care for sentence shapes, and a look at creativechoiceoutlet extended that craft pleasure, sentence level writing quality is something most blog content ignores entirely and this site has clearly invested in the prose layer alongside the substance which is rare today.

  37. Now thinking about how this post will age over the coming years, and a stop at linkcabin 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.

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

  39. Honest take is that I will probably forget most of what I read online today but this post is one I will remember, and a stop at creativechoiceoutlet kept that same memorable quality going, certain writing leaves a residue in the mind in a way most content simply does not manage.

  40. If a friend asked me where to read carefully on the topic I would send them here without hesitation, and a look at findnewinspiration 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.

  41. Liked that there was nothing performative about the writing, and a stop at simplebuyoutlet continued that genuine quality, performative writing tries to be witnessed rather than read and the difference between performance and substance is huge for the careful reader and this site has clearly chosen substance every time clearly.

  42. Picked this post to share in a Slack channel where I knew it would be appreciated, and a look at findpeaceandpurpose 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.

  43. Felt the writer was speaking my language without trying to imitate it, and a look at findyournextgoal continued that natural fit, when a writers default voice happens to match what you find easy to read the experience feels frictionless and that is something I notice and remember about specific sites going forward.

  44. However selective I am about new bookmarks this one made it past my filter, and a look at rankanchor confirmed the bookmark was worth the slot, the precious slots in my permanent bookmark folder are difficult to earn and this site earned one without making me think twice about whether the slot was justified by the quality.

  45. Will be back, that is the simplest way to say it, and a quick visit to trendandstylehub reinforced the decision, this site has earned a spot in my regular rotation alongside a few other reliable places I check when I want something genuinely informative without all the usual modern web noise getting in the way.

  46. Took a chance on the headline and was rewarded, and a stop at discoverbetteroptions kept the rewards coming as I clicked through, the kind of place where every link leads somewhere worth the click is a small luxury on the modern web where so many sites are mostly empty calories disguised as content.

  47. Came away with a slightly better mental model of the topic than I started with, and a stop at creativityunlocked sharpened that further, content that improves the reader thinking apparatus rather than just dumping facts into it is the rare kind I genuinely value and seek out when I have time to read carefully.

  48. Most of the time I feel the open web is in decline and then I find a site like this, and a stop at discoverbetteroptions 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.

  49. Reading this gave me the rare experience of fully agreeing with all the conclusions, and a stop at trendandstylehub continued that agreement pattern, content that aligns with my existing views without seeming designed to do so is just content that happens to be reasonable and this site reads as reasonable rather than ideological mostly.

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

Deixe um comentário

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