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

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

  2. A piece that demonstrated competence without performing it, and a look at linkmotion 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.

  3. KennethBrode KennethBrode

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

  4. Walked away with a clearer head than I had before reading this, and a quick visit to leadcipher only sharpened that, the writing has a way of cutting through the noise that surrounds most topics online which is something I will definitely remember the next time I am searching for an answer to anything.

  5. Picked up several practical tips that I plan to try out this week, and a look at fashionmarketplace added a few more I will be testing alongside, content with practical hooks that connect to my actual life is the kind that earns my repeat attention rather than the merely interesting that I forget within a day.

  6. Reading carefully here has reminded me what reading carefully feels like, and a look at linkchart extended that reminder, the experience of careful reading versus skimming is different in ways I had partially forgotten and this site has clearly refreshed my memory of what attention feels like when content rewards it consistently.

  7. Appreciated how the writer anticipated the questions a reader might have along the way, and a stop at adcrest continued that thoughtful approach, you can tell when content has been edited with the reader in mind versus just published as a first draft and this is clearly the former approach across what I read.

  8. Reading this with a fresh mind in the morning brought out details I might have missed in the afternoon, and a stop at leadquest 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.

  9. Time spent here today felt productive in the way that good reading sessions sometimes do, and a stop at budgetfriendlypicks extended that productive feeling across the rest of the morning, the difference between productive reading and merely passing time is real and this site is consistently on the productive side for me lately.

  10. Useful reading material, the kind I can hand off to someone newer to the topic without worrying about confusing them, and a quick look at discoverandbuy confirmed the same beginner friendly tone runs throughout the site which is great for sharing with people just starting their learning journey on this particular topic.

  11. Easy to recommend, the content speaks for itself without needing additional praise from me, and a stop at linkmotive only adds more reasons to send people this way, the kind of generous resource that benefits its readers without demanding anything in return is increasingly rare and worth recognising clearly today across the broader open internet.

  12. Now understanding why someone recommended this site to me a while back, and a stop at budgetfriendlypicks explained the recommendation, sometimes recommendations make sense only after experience and this site has finally clicked into place as the kind of resource I now understand was being recommended for sound editorial reasons by my friend.

  13. If I am being honest this is the kind of site I quietly hope my own work will someday resemble, and a stop at grabpeak extended that aspirational feeling, finding work that models what I want to produce is part of why I read carefully and this site has been performing that modelling function for me lately consistently.

  14. Reading this prompted me to dig into a related topic later, and a stop at leadblaze provided some of the starting points for that follow up reading, content that triggers further exploration rather than satisfying curiosity completely is content with real generative energy and this site has plenty of that energy throughout it.

  15. TobiasCed TobiasCed

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

  16. Quietly building a case in my head for why this site deserves more attention than it currently seems to receive, and a look at leadblaze reinforced the case, the gap between quality and recognition is a recurring frustration in independent online content and this site is one of the cases that seems particularly egregious to me today.

  17. Over the course of reading several posts here a pattern of quality has emerged, and a stop at rankgrove confirmed the pattern, the difference between sites that hit quality occasionally and sites that hit it consistently is huge and this site has clearly demonstrated the consistent kind through what I have read this morning.

  18. Generally my attention drifts on long posts but this one held it through the end, and a stop at unlocknewpotential earned the same sustained focus, content that defeats my drift tendency is content with substantive pulling power and this site has demonstrated that pulling power across multiple pieces in a session that has now run quite long actually.

  19. After reading several posts back to back the consistent voice across them is impressive, and a stop at leadbeacon 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. Really nice to see things explained without overcomplicating the topic, the words flow naturally and stay easy to follow, and a short visit to leadbeacon only added to that experience because the same simple approach is used across the rest of the page too without any change in tone.

  21. Reading this in three sittings because the day was fragmented, and the piece survived the fragmentation, and a stop at rankdrift held up under similar reading conditions, content engineered for continuous attention is fragile in modern conditions and this site reads as durable across the realistic ways people consume content today.

  22. Took something from this I did not expect to find, and a stop at seoridge added another unexpected useful piece, content that exceeds expectations rather than just meeting them is the kind that builds enthusiasm and earns repeat visits without any explicit ask from the writer or platform behind the work being read.

  23. Going to come back when I have more time to read carefully, the post deserves more than a quick scan, and a stop at linkpilot reinforced that, this is the kind of site that rewards a slower read which is hard to find in this fast paced corner of the internet but really worthwhile.

  24. Quietly the post solved something I had been turning over without quite knowing how to phrase the question, and a look at seobloom extended that quiet solving, content that addresses unformulated needs is content with reader insight and this site has demonstrated that insight at a high rate across the pieces I have read recently.

  25. Closed the tab feeling I had spent the time well, and a stop at learnsomethingamazing extended that feeling across more pages, the test of whether time on a site was well spent is one I apply silently after closing tabs and very few sites pass it but this one passed it cleanly today afternoon clearly.

  26. MichaelEthex MichaelEthex

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

  27. Time spent here today felt productive in the way that good reading sessions sometimes do, and a stop at rankharbor extended that productive feeling across the rest of the morning, the difference between productive reading and merely passing time is real and this site is consistently on the productive side for me lately.

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

  29. linktower linktower

    A piece that suggested careful editing without showing the marks of the editing, and a look at linktower 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.

  30. Just dropping by to say thanks for the effort, it does not go unnoticed when a writer cares this much about the reader, and after I went through yournextadventure I was certain this is one of the better corners of the internet for this particular kind of content which is genuinely refreshing.

  31. Bookmark added without hesitation after finishing, and a look at rankharbor 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.

  32. ThomasKet ThomasKet

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

  33. Considered against the flood of similar content this one stands apart in important ways, and a stop at linkburst 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.

  34. Worth saying that the writing carries a particular kind of authority without making any explicit claims to it, and a stop at seoboostly extended that earned authority feeling, sites that demonstrate expertise through the quality of their explanations rather than by stating credentials are sites I trust most and this site has it.

  35. This filled in a gap in my understanding that I had not even noticed was there, and a stop at leadsurge did the same, the kind of post that gives you more than you expected when you first clicked through from somewhere else, a real find for anyone curious about the area covered here.

  36. ranktower ranktower

    If I am being honest this is the kind of site I quietly hope my own work will someday resemble, and a stop at ranktower extended that aspirational feeling, finding work that models what I want to produce is part of why I read carefully and this site has been performing that modelling function for me lately consistently.

  37. Now adjusting my mental model of how the topic fits into the broader landscape, and a look at seostrike extended that adjustment, content that affects my structural understanding rather than just my factual knowledge is content with deeper impact and this site is providing those structural updates at a meaningful rate consistently across topics.

  38. Top notch writing, every paragraph carries weight and nothing feels like filler, and a stop at smartshoppingzone reflected that same care, a rare thing on the open web these days where most pages exist for clicks rather than actual reader value or anything close to that which is honestly a real shame.

  39. Thanks for laying this out in a way that someone newer to the topic can follow, and a stop at rankloom kept that accessibility going, writing that meets readers at different experience levels without condescending is hard to do well and the writers here have clearly thought about who they are writing for.

  40. opalmeadowgoodsgallery opalmeadowgoodsgallery

    Worth recognising that the post did not pretend to be the final word on the topic, and a stop at opalmeadowgoodsgallery 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.

  41. Reading this slowly to absorb the structure, and the structure is doing real work alongside the words, and a look at seoimpact maintained the same architectural quality, when sentence shapes and paragraph rhythms reinforce the meaning rather than just transporting words you know you are reading skilled work today.

  42. A particular pleasure to read this with a fresh coffee, and a look at simplystylishstore 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.

  43. Grateful for posts like this one, they remind me there are still places online run by people who care about quality, and a look at leadloom reflected the same standards, you can tell the difference between content made for readers and content made just for search engines today and this is the former.

  44. Reading carefully here has reminded me what reading carefully feels like, and a look at leadpush extended that reminder, the experience of careful reading versus skimming is different in ways I had partially forgotten and this site has clearly refreshed my memory of what attention feels like when content rewards it consistently.

  45. Thanks for putting in the work to make this approachable, plenty of sites cover the same ground but most do it badly, and a quick visit to leadlayer confirmed this one stands apart, simple language and useful examples without anyone trying to sell me anything along the way which I really appreciated.

  46. Reading this triggered a small but real correction in something I had assumed, and a stop at linksignal extended that corrective effect, content that updates my beliefs through evidence rather than rhetoric is content with intellectual integrity and this site has earned that label consistently across the pieces I have read so far today.

  47. Now adjusting my mental list of reliable sites for this topic, and a stop at moveforwardnow reinforced the adjustment, the small ongoing curation work of maintaining trusted sources is one of the actual practical activities of careful reading and this site has earned a permanent place on my list for this particular subject.

Deixe um comentário

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