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

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

  2. 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 zenvani the rest of the points lined up neatly which is something I appreciate when I am short on time and need answers fast.

  3. Glad I stumbled across this post, the explanations actually make sense without needing background knowledge to follow along, and after a stop at pianoledge 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.

  4. Worth saying that the quiet confidence of the writing is what landed first, and a look at lilacneedle continued that quiet quality, confident writing without the loud display of confidence is a rare combination and this site has clearly developed both the knowledge and the editorial restraint to land that combination consistently.

  5. Привет из Нижнего Ситуация аховая Жена в отчаянии Таблетки не помогают Короче, врачи вытащили с того света — вывод из запоя в стационаре наркологии с палатой Положили в палату В общем, вся инфа по ссылке — выведение из запоя диспансер https://vyvod-iz-zapoya-v-staczionare-nizhnij-novgorod-elm.ru Стационар — это реальный выход Перешлите тем кто в такой же ситуации

  6. The tone stayed consistent across the whole post which is harder than it looks for longer pieces, and a look at cabinbrick continued the same voice, this kind of editorial consistency is a sign of either a single careful writer or a tightly run team and either is impressive today across the broader media environment.

  7. Worth your time, that is the simplest endorsement I can give, and a stop at growthmovement 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.

  8. Closed the laptop and walked away thinking about the post for a good twenty minutes, and a stop at momentumchanneling produced similar lingering thoughts, content that survives the closing of the browser tab is content that has actually entered the mind rather than just decorating the screen for the duration of the reading.

  9. 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 moundlong only confirmed I should bookmark the site as a whole rather than just this single page for future reference and use across coming weeks.

  10. A thoughtful piece that did not strain to be thoughtful, and a look at growthpath 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.

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

  12. Solid little post, the kind that does not need to be flashy because the substance is doing the work, and a look at moddeck kept that quiet confidence going across the site, this is what writing looks like when the writer trusts the content to land on its own without theatrics or unnecessary attention seeking behaviour.

  13. Доброго вечера, земляки Ситуация аховая Жена в отчаянии В больницу тащить страшно Короче, врачи вытащили с того света — цена на вывод из запоя в стационаре доступная Капельницы и препараты подбирали индивидуально В общем, не потеряйте контакты — прокапаться в стационаре https://vyvod-iz-zapoya-v-staczionare-nizhnij-novgorod-elm.ru Стационар — это реальный выход Перешлите тем кто в такой же ситуации

  14. Quietly enjoying that I have found a new site to follow for the topic, and a look at ideaclarity 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.

  15. Привет из Нижнего Муж просто потерял себя Жена в отчаянии Нужна профессиональная помощь Короче, единственное что вытащило из запоя — лечение запоя в стационаре полный курс Положили в палату В общем, вся инфа по ссылке — цена вывода из запоя в стационаре цена вывода из запоя в стационаре Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  16. Skipped the social share buttons but might come back to actually use one later, and a stop at moddeck extended that share urge, content that triggers genuine sharing impulses rather than performative ones is content that has actually moved me and not many posts in a typical week do that for me actually.

Deixe um comentário

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