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

  1. Skipped the social share buttons but might come back to actually use one later, and a stop at walnutcovemerchantgallery 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.

  2. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  3. Started thinking about my own writing differently after reading, and a look at fudgebrindle continued that reflective effect, content that influences how I work rather than just informing what I know is content with the highest kind of impact and this site has triggered some of that reflective influence today on me.

  4. Слушайте кто участки смотрит А в росреестре ждать по три недели Соседей проверить Короче, работает быстро и понятно — публичная кадастровая карта россии онлайн с обновлениями Увидел границы и форму участка В общем, сохраняйте себе — публичная кадастровая карта москва https://publichnaya-kadastrovaya-karta-jkl.ru Не парьтесь с росреестром Перешлите тому кто ищет участок

  5. Люди подскажите А в росреестре очереди и бумажки Категорию земли уточнить Короче, работает быстро и понятно — публичная кадастровая карта с 3D-видом Нашел всё за 10 минут В общем, вся инфа вот здесь — найти участок по кадастровому номеру https://publichnaya-kadastrovaya-karta-def.ru Пользуйтесь нормальной картой Перешлите тому кто ищет участок

  6. Now sitting back and recognising that this was a small but real win in my reading day, and a stop at pyxedge extended that quiet win, the cumulative effect of small reading wins versus the cumulative effect of small reading losses is real over time and this site is contributing to the wins side of that ledger.

  7. Слушайте что расскажу. Жесть случилась полная. Человек уже четвёртые сутки в штопоре. Жена в слезах. Скорая не едет. Короче, единственное что реально помогло — профессиональное выведение из запоя капельницей. Приехали через час. В общем, вся инфа вот здесь — выведение из запоя на дому https://vyvod-iz-zapoya-na-domu-samara-yza.ru Каждая минута дорога. Перешлите тому кому надо.

  8. Reading this confirmed something I had been suspecting about the topic, and a look at agaveamber pushed that confirmation toward greater confidence, content that lines up with independently held intuitions earns a special kind of trust and I will return to writers who consistently land that way for me without overselling positions.

  9. Now wishing I had found this site sooner, and a look at dailyneedsstore extended that mild regret, the calculation of how many years of good content I missed by not finding the right sources earlier is one I try not to make too often but it does come up sometimes when I find sites this good.

  10. Davidspern Davidspern

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

  11. Самарцы привет. Столкнулся с такой бедой. Муж просто пропадает. Дети не спят ночами. В диспансер везти — учёт на всю жизнь. Короче, только это и спасло — срочный вывод из запоя круглосуточно. Отошёл за полчаса. В общем, вся инфа вот здесь — вывод из запоя круглосуточно самара https://vyvod-iz-zapoya-na-domu-samara-yza.ru Каждая минута дорога. Скиньте другу в беде.

  12. Слушайте что расскажу. Столкнулся с такой бедой. Человек уже четвёртые сутки в штопоре. Дети не спят ночами. В диспансер везти — учёт на всю жизнь. Короче, нормальные врачи нашлись — профессиональное выведение из запоя капельницей. Приехали через час. В общем, жмите чтобы не потерять — вывод из запоя на дому цена https://vyvod-iz-zapoya-na-domu-samara-yza.ru Не надейтесь на авось. Скиньте другу в беде.

Deixe um comentário

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