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.

8.113 Comentários

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

  2. Quietly enthusiastic about this site after the past few hours of reading, and a stop at dabbyrd extended that enthusiasm, the calibration of enthusiasm to evidence is something I try to maintain and this site has earned a calibrated quiet enthusiasm rather than the loud excitement that usually fades within a day or two of finding something.

  3. ScottGurgy ScottGurgy

    Нарколог на дом в Балашихе с быстрым приездом специалиста, осмотром пациента и медицинской поддержкой в наркологической клинике «Похмельная служба».
    Разобраться лучше – http://narkolog-na-dom-balashiha13-4.ru

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

  5. Reading this in segments because the day was busy, and the post survived the fragmented attention well, and a stop at quarkpivot held up similarly under interrupted reading, content that can withstand modern distracted reading patterns rather than requiring a perfect block of focused time is increasingly the kind I prefer.

  6. Felt the post was written for someone like me without explicitly addressing me, and a look at pantheroffer produced the same fit, when content lands on its target without pandering you know the writer has done careful audience thinking rather than relying on demographic targeting or interest signals to do the work of editorial decisions.

  7. DavidGaima DavidGaima

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

  8. Probably the kind of site that should be more widely read than it appears to be, and a look at vanqiro reinforced that quiet wish, the gap between a sites quality and its apparent reach is sometimes large and that gap exists for this site in a way that makes me want to mention it more.

Deixe um comentário

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