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

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

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

  3. 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 naviroshop 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.

  4. Dennismaite Dennismaite

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

  5. A small thank you note from me to the team behind this work, the post earned it, and a stop at cnsbiodesk suggested more thanks would be in order over time, recognising the people who do good writing online is something I try to remember to do because the alternative is silence and silence rewards mediocrity unfortunately.

  6. JimmieWheek JimmieWheek

    Лечение в стационаре позволяет провести детоксикацию, снять абстинентный синдром, уменьшить тревожность, восстановить сон и подготовить человека к дальнейшей терапии алкогольной зависимости. В нашей клинике помощь организована круглосуточно: можно оставить заявку через форму сайта, получить онлайн-консультацию, вызвать специалиста, заказать транспортировку или уточнить цены по телефону. Поэтому в нашей частной клинике в Краснодаре лечение проходит строго анонимно.
    Разобраться лучше – https://vyvod-iz-zapoya-v-statsionare-v-gelendzhike3.ru/

  7. BrandonWix BrandonWix

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

  8. Speaking as someone who reads a lot on this topic this site has earned a high position in my source rankings, and a stop at plavexshop reinforced that ranking, the informal ranking of sources for a topic is something I maintain mentally and this site has moved into the upper portion of those rankings clearly.

  9. Genuinely well crafted writing, the kind that makes the topic look easier than it actually is, and a look at plavexpath added even more depth, you can feel the experience behind every line which is something only writers who have been at this for a while can pull off with this level of grace.

  10. A piece that handled a controversial angle without becoming heated, and a look at zylvo continued that calm engagement, content that can address contested topics without inflaming them is doing rare diplomatic work and this site has clearly developed the editorial maturity to handle sensitive material with the appropriate temperature of writing throughout.

  11. Definitely a recommend from me, anyone curious about the topic should check this out, and a look at navirotrustee adds even more reason for that, the depth and quality combine to make this site one I will be pointing people toward whenever similar conversations come up over the months ahead at work or socially.

  12. Now planning to share the link with a small group of readers I trust, and a look at quvexoria suggested more material to share with the same group, recommending content into a curated circle requires confidence in the recommendation and this site is making me confident in those personal recommendations on multiple separate occasions now.

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

Deixe um comentário

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