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

  1. Glad I gave this a chance rather than scrolling past, and a stop at markpillow confirmed I made the right call, sometimes the best content is hidden behind unassuming headlines that do not scream for attention and learning to slow down and check those out has paid off many times now across years of reading.

  2. Started reading expecting to disagree and ended mostly nodding along, and a look at progressigniter continued the pattern, content that wins agreement through evidence and reasoning rather than rhetorical force is the kind that actually shifts minds and this site clearly knows how to do that across what I have read so far.

  3. Самара, всем привет Ситуация знакомая Поилки и таблетки не помогают Короче, единственное что реально спасает — капельница при похмелье с препаратами Через час состояние нормализовалось В общем, телефон и цены тут — прокапаться самара https://kapelnicza-ot-pokhmelya-samara-lhb.ru Капельница — это быстро и эффективно Перешлите тем кто в такой же ситуации

  4. Liked that there was nothing performative about the writing, and a stop at pianoloud 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.

  5. Edwincusly Edwincusly

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

  6. Reading this on the train into work was a better use of the commute than my usual choices, and a stop at vexsync 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.

  7. Reading this in pieces during a long afternoon and finding it consistently rewarding, and a stop at claritypathways fit naturally into the same fragmented reading pattern, sites whose posts can be read in segments without losing the thread are well suited to how I actually read these days and this one is built well.

  8. Reading this slowly to give it the attention it deserved, and a stop at bazmora earned the same slow read, choosing to read slowly is a small act of respect for content quality and very few sites earn that respect from me but this one did so without any explicit ask which is the cleanest way.

  9. Started forming counter examples to test the claims and the post handled most of them implicitly, and a look at focusmechanism continued that anticipatory style, writers who think two steps ahead of the critical reader save themselves from a lot of follow up work and this writer has clearly internalised that habit consistently.

  10. If you asked me to point to a recent positive sign for the open web this site would be near the top, and a stop at growthenginepath reinforced that designation, the few sites that serve as evidence the web can still produce quality independent content are precious and this one has clearly become one for me.

  11. Люди подскажите Сосед совсем спился Мать места себе не находит В диспансер тащить — страшно Короче, единственное что сработало — наркологический стационар с круглосуточным наблюдением Положили в палату В общем, телефон и цены тут — сколько стоит прокапаться от алкоголя в стационаре https://narkologicheskij-staczionar-moskva-fal.ru Не ждите чуда Перешлите тем кто в такой же беде

  12. Found the use of subheadings really helpful for scanning back through the post later, and a stop at buffbey kept that reader friendly approach going, navigation is something many blog writers ignore but small structural choices make a noticeable difference for someone returning to find a specific point again days or weeks later.

  13. Здорова, народ Сосед совсем спился Соседи уже вызвали полицию В диспансер тащить — страшно Короче, врачи стационара реально помогли — платный наркологический стационар с палатами Провели полное очищение организма В общем, телефон и цены тут — лечение алкоголизма стационар цены https://narkologicheskij-staczionar-moskva-fal.ru Стационар — единственное решение Перешлите тем кто в такой же беде

  14. Reading this gave me a small framework I expect to use going forward, and a stop at strategybuilder extended that framework, content that produces transferable mental models rather than just specific facts is content with multiplicative value and this site is providing those models at a rate that justifies extra attention from me regularly.

  15. Worth pointing out the careful word choice in this post, no buzzwords and no jargon, and a look at neonmotel continued that disciplined vocabulary, sites that resist the pull of trendy language are sites that will read well in five years and this one is clearly built for that kind of long durability.

  16. Now feeling something close to gratitude for the fact this site exists, and a look at amberlume extended that gratitude, the rare site that produces this kind of response is the rare site worth defending in conversations about whether the modern internet is still capable of producing genuinely valuable independent content for serious adults.

  17. Worth flagging that this approach to the topic is fresh without being contrarian, and a stop at byrdbush extended the same fresh angle, finding original perspective on familiar subjects is rare and this site has clearly developed its own way of seeing rather than echoing the dominant takes from elsewhere consistently.

  18. Decided to set a calendar reminder to revisit, and a stop at holdax extended that revisit list, calendar entries for content are a level of commitment I rarely make but when I do they signal a higher regard than a simple bookmark and this site has earned that calendar tier of relationship from me today.

  19. звоните круглосуточно по телефону горячей линии клиники: наши специалисты готовы оказать необходимую помощь в решении проблемы алкогольной зависимости.
    Получить больше информации – http://vyvod-is-zapoya-sochi22.ru/

  20. Recommended to anyone working in or curious about this area, the depth and clarity combine well, and a look at shoprova keeps that going across more pages, the kind of site that earns regular visits rather than chasing trends has my respect because it suggests genuine commitment to the topic itself rather than to chasing trends.

  21. Vague feelings of recognition kept surfacing as I read because the writing names things I have been thinking, and a look at valzino produced more of those recognition moments, content that gives shape to private intuitions is content that makes me feel less alone in my own thinking and this site has that effect.

  22. Quietly enjoying that I have found a new site to follow for the topic, and a look at claritybuilder reinforced the small pleasure of the find, the discovery of new high quality sources is one of the more durable pleasures of careful internet reading and this site has been generating that discovery pleasure at multiple points already today.

  23. Following a few of the internal links revealed more posts of similar quality, and a stop at actionforwardnow added more to that growing pile, sites where internal links lead to more good content rather than to more of the same recycled material are sites with depth and this one has clearly built that depth carefully.

  24. Top tier post, the kind that makes you want to share the link with friends working in the same area, and a stop at ideaflowengine 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.

  25. Refreshing to read something where the words actually mean something instead of filling space, and a stop at pillowmanor kept that going, the writing here trusts the reader to follow along without endless repetition or constant reminders of what was already said earlier in the post which I appreciate.

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

  27. Generally I bookmark sparingly to avoid building up a bookmark graveyard but this one earned a permanent slot, and a stop at focusframework extended that permanence designation, the few sites I keep permanent bookmarks for are sites I expect to use repeatedly and this one has clearly cleared that expectation bar today.

  28. One of the more thoughtful posts I have read recently on this topic, and a stop at cartvilo added even more weight to that impression, this is genuinely good content that holds its own against far better known sites in the same space without trying to imitate any of them at all which I appreciate.

  29. Здорова, народ Брат снова сорвался Соседи стучат в стену В больницу тащить страшно Короче, единственное что вытащило из запоя — капельница от запоя на дому круглосуточно Сняли ломку и стабилизировали состояние В общем, жмите чтобы сохранить — капельница от алкоголя на дому капельница от алкоголя на дому Капельница — это реальный выход Перешлите тем кто в такой же ситуации

  30. Decided not to skim despite my usual habit and was rewarded for the discipline, and a stop at ampleclam earned the same patient approach, training myself to recognise sites that warrant slower reading is part of being a careful online reader and this site is the kind that helps me practice that skill regularly.

  31. Really appreciate that the writer did not overstate the importance of the topic to make the post feel weightier, and a quick visit to nickelpearl maintained the same modest framing, content that is honest about its own scope rather than inflating itself is the kind I trust and return to repeatedly over time.

  32. Reading this prompted me to send the link to two different people for two different reasons, and a stop at modrivo provided ammunition for a third share, content that suits multiple audiences without being generic enough to be useless to any of them is genuinely valuable and this site has that multi audience quality clearly.

  33. Москва, всем привет Муж просто потерял себя Дети напуганы до смерти Скорая не приедет на такой вызов Короче, единственные кто взялся за сложный случай — платный наркологический стационар с палатами Капельницы и препараты подбирали индивидуально В общем, телефон и цены тут — сколько стоит прокапаться от алкоголя в стационаре https://narkologicheskij-staczionar-moskva-gsh.ru Не надейтесь что само пройдёт Это может спасти чью-то семью

  34. Доброго дня, земляки Тошнит, трясёт, сил нет Нужно что-то серьёзное Короче, врачи приехали и поставили систему — капельница при похмелье с препаратами Голова прошла и тошнота ушла В общем, не потеряйте контакты — капельница от алкоголя цена самара https://kapelnicza-ot-pokhmelya-samara-lmr.ru Не мучайтесь рассолами Перешлите тем кто в такой же ситуации

  35. Glad I gave this a chance instead of bouncing on the headline, and after amberflux I was certain I had made the right call, snap judgements based on titles miss a lot of good content and this is a reminder to slow down and check things out before scrolling past in a hurry.

  36. This stands out compared to similar posts I have read recently, less noise and more substance, and a look at directionalsystems kept that gap going, you can really feel the difference between content made by someone who cares versus content made to fill a publishing schedule for an algorithm trying to keep growing somehow.

  37. Слушайте кто сталкивался Соседний мужик совсем спился Родные просто в шоке Платная наркология — бешеные счета Короче, врачи стационара реально помогли — платный наркологический стационар с палатами Выписали через 4 дня здоровым В общем, не потеряйте контакты — сколько стоит прокапаться от алкоголя в стационаре https://narkologicheskij-staczionar-moskva-cde.ru Не надейтесь на чудо Это может спасти жизнь близкого

  38. Felt like the writer was speaking directly to someone with my level of curiosity, neither talking down nor showing off, and a stop at promparsley kept that comfortable matching going, finding writing that meets you where you are rather than asking you to climb up or stoop down feels great every time it happens.

  39. Good quality through and through, no rough edges and no signs of being rushed, and a quick look at strategyforward kept the same polish going, the kind of site that respects its own brand by maintaining consistency across pages which is something I always appreciate as a reader looking for trustworthy information online today.

  40. Useful read, especially because the writer did not assume too much background from the reader, and a quick look at moveideasforwardnow 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.

  41. JamesUnods JamesUnods

    выездная наркологическая служба оперативно приедет по указанному адресу, имея при себе все необходимое оборудование и медикаменты, в том числе для оказания неотложной помощи.
    Выяснить больше – вывод из запоя клиника в сочи

  42. Москва, всем привет Мой брат уже две недели в запое Дети боятся даже подходить В диспансер тащить — стыд и страх Короче, спасла только госпитализация — наркологический стационар с полным обследованием Врачи и медсёстры круглосуточно В общем, вся инфа по ссылке — наркологическая больница стационар наркологическая больница стационар Звоните прямо сейчас Это может спасти жизнь близкого

  43. Reading this prompted me to dig into a related topic later, and a stop at qinzavo 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.

  44. 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 mauvepeach kept that same memorable quality going, certain writing leaves a residue in the mind in a way most content simply does not manage.

Deixe um comentário

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