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

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

  2. Marvinfoors Marvinfoors

    Нарколог на дом в Казани — это срочная медицинская помощь пациенту при запое, похмелья, интоксикации, абстинентного синдрома, наркотической ломки и других ситуациях, когда человеку сложно самостоятельно обратиться в клинику. Врач приезжает на дом, проводит осмотр, диагностику состояния, подбирает препараты, ставит капельница и дает рекомендации по дальнейшему лечению зависимости.
    Узнать больше – https://narkolog-na-dom-kazan24.ru/

  3. Reading this gave me a small mental break from the heavier reading I had been doing, and a stop at coppercovemerchantgallery extended that lighter feel, content that provides relief without becoming trivial is harder to produce than people realise and this site has clearly figured out how to be light without being shallow at all.

  4. Well crafted post, the structure flows naturally from one point to the next without forcing transitions, and a stop at dylcane kept the same flow going, you can tell when a writer has thought about how their content reads rather than just what it contains and this is one of those examples.

  5. Strong recommendation, anyone interested in this topic owes themselves a visit, and a stop at agaveamber extends that recommendation across more of the site, this is the kind of resource that makes me more optimistic about the state of the open web than I usually am these days actually for once which is genuinely refreshing.

  6. Glad I gave this a chance instead of bouncing on the headline, and after agavebarley 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.

  7. Solid value for anyone willing to read carefully, and a look at copperharborcommercegallery extends that value across the rest of the site, this is the kind of place that rewards return visits rather than offering everything in a single splashy post and then leaving readers nothing to come back for later which is unfortunately common.

  8. One more issue is that video games are generally serious anyway with the key focus on studying rather than enjoyment. Although, there is an entertainment aspect to keep your kids engaged, each and every game is usually designed to focus on a specific set of skills or programs, such as instructional math or scientific research. Thanks for your publication.

  9. Aw, this was an incredibly good post. Taking the time and actual effort to make a good article… but what can I say… I put things off a lot and don’t seem to get nearly anything done.

  10. Доброго дня, земляки. Брат не выходит из штопора. Соседи уже стучат в стену. Скорая не приедет на такой вызов. Короче, спасла только эта бригада — вывод из запоя цены доступные. Сняли абстинентный синдром. В общем, не потеряйте — круглосуточный вывод из запоя нарколог 24 https://vyvod-iz-zapoya-na-domu-sankt-peterburg-zqe.ru Каждый час ухудшает состояние. Вдруг это спасёт чью-то жизнь.

  11. Now planning to come back when I have the right kind of attention to read carefully, and a stop at dunecovemerchantgallery reinforced that plan, choosing the right moment to read certain content is a quiet form of respect for the work and this site is generating those careful planning behaviours from me consistently as a reader.

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

  13. Салют, Питер. Отец не выходит из штопора. Соседи уже стучат в стену. Платная клиника — грабёж. Короче, единственные, кто быстро приехал и помог — вывод из запоя цены фиксированные. Врач сразу поставил капельницу. В общем, жмите, чтобы сохранить — вывод из запоя нарколог24 https://vyvod-iz-zapoya-na-domu-sankt-peterburg-mnq.ru Звоните прямо сейчас. Перешлите тем, кто рядом с бедой.

  14. I have read so many content regarding the blogger lovers however this post is really a fastidious piece of writing, keep it up.

  15. Honestly the simplicity of the explanation made the topic click for me in a way other writeups had not, and a look at progresswithoutpressure continued that clarity into related areas, when a writer gets the level of explanation right the reader does the heavy lifting themselves and the post just enables it.

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

Deixe um comentário

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