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

  1. Reading this slowly and letting each paragraph land before moving on, and a stop at YungBludComic earned the same patient approach, content that rewards slow reading rather than speed is content with real density and the writers here are clearly producing work that benefits from the careful eye rather than the rushed scan.

  2. Israelvex Israelvex

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

  3. Georgejowly Georgejowly

    Вывод из запоя в Люберцах требуется, когда человек несколько дней находится в запойном состоянии, принимает алкоголь, не может самостоятельно остановиться, плохо спит, испытывает тремор, тревогу, тошноту, слабость, скачки давления или признаки отравления. В таких случаях важно не ждать, что организм полностью справится сам, а обратиться за медицинской помощью: врач оценивает состояние пациента, длительность запоя, количество спиртного, наличие хронических заболеваний и подбирает безопасное лечение.
    Исследовать вопрос подробнее – vyvod iz zapoya dzerzhinskij

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

  5. Georgejowly Georgejowly

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

  6. Honestly this kind of writing is why I still bother to read independent sites, and a look at qulavotrust extended that broader reflection, the few sites that justify continued attention to non algorithmic content are sites like this one and finding them periodically is enough to keep my reading habits oriented toward independent rather than aggregated content.

  7. Liked that there was nothing performative about the writing, and a stop at crownaboutnow continued that genuine quality, performative writing tries to be witnessed rather than read and the difference between performance and substance is huge for the careful reader and this site has clearly chosen substance every time clearly.

  8. I really like the calm tone here, it does not push anything on the reader, and after I went through votethurm I felt the same way, just steady useful content laid out without drama, which is exactly what someone trying to learn something quickly needs to find rather than aggressive marketing.

  9. Danielwharo Danielwharo

    В этой статье рассматриваются различные аспекты избавления от зависимости, включая физические и психологические методы. Мы обсудим поддержку, мотивацию и стратегии, которые помогут в процессе выздоровления. Читатели узнают, как преодолеть трудности и двигаться к новой жизни без зависимости.
    Не упусти важное! – https://zapoy-voronezh.ru/uslugi/kodirovanie/kodirovanie-ot-pischevoy-zavisimosti

  10. Georgejowly Georgejowly

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

  11. Now noticing the careful balance the post struck between confidence and humility, and a stop at fivestarlandandlivestock maintained the same balance, finding the line between asserting and admitting is hard and this site has clearly developed the calibration to walk that line consistently which produces a more persuasive reading experience for me.

  12. betsoft casinos united kingdom no deposit bonus, united kingdom online casino free chip and yukon gold morongo casino bonus (Rogelio), or usa
    casino age restriction

  13. Honestly this was the highlight of my reading queue today, and a look at holyspiritschooleg extended that across more pages I will return to, ranking what I read against what else I read each day is something I do informally and this site keeps moving up in those rankings the more I explore it.

  14. buy poker machine australia, poker australia tournaments and big usa slot wins, or usa online
    casino no deposit bonus codes 2021

    Here is my blog: gambling is legal in every state
    except, Jaqueline,

  15. Andrewhow Andrewhow

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

  16. If the topic interests you at all this is a place to spend time, and a look at motivilovesmusic reinforced that recommendation, the broader question of where to invest topical reading time is one this site answers convincingly through the consistent quality across multiple pieces I have sampled during the current reading session today.

  17. Started smiling at one paragraph because the writing was just nice, and a look at ulayjasa produced a couple more such moments, prose that produces small spontaneous reactions in the reader is doing more than just transferring information and the writers here are clearly hitting that level fairly consistently throughout pieces.

  18. xpokies no deposit bonus codes australia 2021, australia gambling winnings taxable and united statesn real
    money casino game source code (Latanya), or
    online poker licence australia

  19. Reading this triggered a small but real correction in something I had assumed, and a stop at norigamihq extended that corrective effect, content that updates my beliefs through evidence rather than rhetoric is content with intellectual integrity and this site has earned that label consistently across the pieces I have read so far today.

  20. Genuinely glad I clicked through to read this rather than skipping past, and a stop at ulayjasa confirmed I should keep clicking through to more pages here, the kind of resource that justifies its place in my browser history rather than feeling like wasted time which is the highest compliment I offer any site online today.

Deixe um comentário

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