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.

10.038 Comentários

  1. Reading this in the morning set a good tone for the day, and a quick visit to clyra 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.

  2. During a reading session that included several other sources this one stood out, and a look at plivoxcapital 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.

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

  4. Honestly the simplicity is what makes this work, the topic is not buried under filler words or overly complex examples, and a quick look at morixotrust showed the same sensible style, I left with what I came for and no headache from over reading which is a real win these days.

  5. Donaldral Donaldral

    Запойное состояние опасно развитием тяжелых последствий, поэтому важно вовремя распознать тревожные симптомы. При длительном употреблении спиртного у человека возникают болезненные проявления абстиненции: сильная усталость, панические атаки, тревожные расстройства, бессонница и скачки артериального давления. В таких случаях требуется немедленная помощь нарколога, ведь самостоятельный выход из запоя практически невозможен и грозит инсультом, алкогольным психозом и глубокой депрессией. Лечение на дому или в стационаре клиники должно начаться как можно быстрее, чтобы предотвратить необратимые изменения в головном мозге и внутренних органах. Многие алкоголики со стажем ошибочно полагают, что смогут справиться сами, однако резкий отказ от спиртного без врачебного контроля часто приводит к судорогам, потере сознания и острой сердечной недостаточности.
    Узнать больше – vyvod-iz-zapoya-v-klinike-v-moskve

  6. Now feeling mildly impressed in a way I do not quite remember feeling about a blog in a while, and a stop at xaneroline 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.

  7. Really like that the writer trusts the reader to follow simple logic without restating every previous point, and a stop at ulvarotrust kept that respect going, treating an audience as capable adults rather than as people who need constant hand holding makes a noticeable difference in the reading experience for me.

  8. Alfredaddig Alfredaddig

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

  9. Worth marking the moment when reading this clicked into something useful for my own work, and a look at zexarocore extended that practical click, content that connects to my actual life rather than just being interesting is content with the highest kind of value and this site is generating that connection at a high rate.

  10. Closed the tab feeling I had spent the time well, and a stop at ravionbondgroup 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.

  11. Appreciated the way each section connected smoothly to the next without abrupt jumps, and a stop at nevironline 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.

  12. Skipped the related products section because there was none, and a stop at zexarotrustco also lacked any aggressive monetisation, content that is not constantly trying to convert me into a customer or subscriber is content that has confidence in its own value and that confidence shows up as a different reading experience.

  13. Glad the writer did not feel the need to argue with imaginary critics in the post itself, and a stop at corporatetrustnetwork kept the same focused approach going, defensive writing wastes the reader time and confidence on positions that did not need defending and this post has clearly avoided that common failure.

  14. Such writing is increasingly rare and worth supporting through attention, and a stop at nixaroline extended that supportive attention across more pages, the conscious choice to spend time on sites that produce careful work rather than convenient consumption is itself a small form of patronage and this site is receiving that conscious patronage from me.

  15. Found this through a friend who recommended it and now I see why, and a look at xelariobase only strengthened that recommendation in my own mind, word of mouth still works for content that actually delivers and this site is clearly earning recommendations the old fashioned way through quality rather than marketing.

  16. A quiet kind of confidence runs through the writing, and a look at yaverobond carried that same understated assurance, confidence without bragging is the most attractive register for online writing and the writers here have clearly developed it through practice rather than affecting it through stylistic tricks that would feel hollow eventually.

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

  18. Слушайте кто хочет гражданство Израиля А бюрократия эта просто выносит мозг Друзья уже полгода мучаются Короче, единственные кто реально помогает — репатриация израиль с профессиональной поддержкой Через 2 месяца получили паспорт В общем, там и цены и отзывы — бюро репатриации москва бюро репатриации москва Доверьтесь профессионалам Перешлите тому кто думает о репатриации

  19. Glad I stumbled across this post, the explanations actually make sense without needing background knowledge to follow along, and after a stop at vexarotrustco the same was true there, no assumptions about the reader just clear writing that anyone can understand from the first line right through to the end.

  20. Solid endorsement from me, the writing earns it, and a look at xevirocore continues to earn it across the broader site too, the kind of operation that maintains quality across many pages rather than just one viral post is a sign of serious commitment and that is what I see here clearly across what I read.

  21. Just wanted to say this was useful and leave a small note of thanks, and a quick visit to yaverobond earned a similar nod from me, the small acknowledgements add up over time and represent the real economy of trust that good content runs on across the open and increasingly fragmented modern internet.

  22. Came in confused about the topic and left with a much firmer grasp on it, and after neviromart I felt I could explain this to someone else without hesitation, that is the gold standard for any educational content and most sites simply fail to reach it ever which is unfortunate but true.

  23. Здорово, народ Объездил кучу контор — везде одно и то же То логотип кривой Короче, мужики с руками из правильного места — корпоративные подарки на заказ с доставкой Лого нанесли идеально В общем, жмите чтобы не потерять — бизнес-сувениры бизнес-сувениры Не ведитесь на дешёвые предложения Перешлите тому у кого бизнес

  24. Народ у кого бизнес Цены задрали как на золото То вообще привозят не то что заказывали Короче, ребята которые делают качественно — фирменная продукция с логотипом любого тиража Упаковка премиум класса В общем, там каталог и цены — корпоративные подарки мерч корпоративные подарки мерч Не ведитесь на дешёвые предложения Перешлите тому у кого бизнес

  25. Now noticing how rare it is to find a site that does not feel rushed, and a look at vexarotrustco extended that calm pace, content produced without time pressure has a different quality than content shipped to meet a deadline and this site reads as written without urgency which produces a different and better experience for readers.

  26. Liked the post enough to read it twice and the second read found new things, and a stop at xevirocore 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.

  27. Слушайте кто сталкивался Муж просто потерял себя Дети напуганы В больницу тащить страшно Короче, только это реально спасло — нарколог на дом срочно Через пару часов человек пришёл в себя В общем, вся инфа по ссылке — вызов врача нарколога на дом воронеж https://lechenie.narkolog-na-dom-voronezh-13.ru Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  28. Now planning to write about the topic myself eventually using this post as a reference, and a look at brucknerbythebridge would also serve in that future piece, content that becomes raw material for my own writing rather than just informing my reading is content with multiplicative value and this site is generating that multiplicative effect.

  29. Pass this along to anyone you know dealing with similar questions, the answers here are clear, and a stop at pixelmoar adds even more useful material, this is the kind of resource that deserves to circulate widely rather than getting lost in the constant churn of new content online that buries good work daily.

  30. Such writing is increasingly rare and worth supporting through attention, and a stop at eleanakonstantellos extended that supportive attention across more pages, the conscious choice to spend time on sites that produce careful work rather than convenient consumption is itself a small form of patronage and this site is receiving that conscious patronage from me.

  31. A thoughtful read in a week that has been mostly noisy, and a look at maverobond carried that thoughtful quality across more pages, finding pockets of considered writing in a week of distractions is one of the small wins of careful curation and this site is providing those pockets at a sustainable rate.

Deixe um comentário

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