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.

11.533 Comentários

  1. Probably one of the more reliable sources I have found for this kind of careful coverage, and a look at metatagmart reinforced the reliability, the small group of sources I would describe as reliable for a given topic is curated carefully and this site has earned a place in that small group through consistent performance.

  2. Came across this and immediately thought of a friend who would enjoy it, and a stop at wildwarehouse also reminded me of someone, content that triggers the urge to share is content that has earned my recommendation and this site has earned multiple from me already across different conversations during the week.

  3. Reading this on a long flight and finding it the best thing I read across hours of trying, and a stop at wildwarehouse kept the streak going, when content beats long flight reading you know it has substance because flight reading is a hard test of a piece given the alternatives available everywhere.

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

  5. Thanks for putting this online without locking it behind email signups or paywalls, and a quick visit to dewcrate kept that open feel going, content that trusts the reader to come back rather than gating access is the kind of approach I will reward with regular return visits over time happily.

  6. Quietly enthusiastic about this site after the past few hours of reading, and a stop at goldenvendorhouse 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.

  7. Michaelmow Michaelmow

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

  8. new 2021 little creek casino rv sites (Duane) uk, sweet bonausaa online slot and united statesn online slots real
    money, or top 50 online casinos uk

  9. Thanks for the honest framing without exaggerated claims that the topic will change my life, and a stop at legendlocker kept the same modest tone, restraint in marketing language signals trustworthiness and the writers here are clearly playing the long game by building credibility rather than chasing immediate clicks through hyperbole.

  10. Patrickpog Patrickpog

    Чтобы вызвать специалиста, необходимо связаться с наркологическим центром по телефону или оформить заявку через сайт, если такая форма предусмотрена. Во время обращения оператор обычно уточняет район Воронежа, точный адрес, возраст человека, продолжительность запоя или характер наркотической проблемы, а также основные жалобы. Эти данные нужны не из любопытства: они помогают подготовить выезд, необходимые препараты и оборудование.
    Дополнительная информация – https://2.narcolog-na-dom-voronezh0.ru/

  11. Took me back a step or two on an assumption I had been making, and a stop at dawnbundle pushed that reconsideration further, writing that gently corrects the reader without being aggressive about it is a rare diplomatic skill and the team here clearly knows how to land critical points without turning readers off.

  12. Michaelmop Michaelmop

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

  13. Charleswen Charleswen

    Вывод из запоя в Реутове в наркологической клинике «Детокс» — это комплексное лечение алкогольной интоксикации, абстинентного синдрома и связанных с длительным употреблением спиртного нарушений. Медицинская помощь доступна круглосуточно: нарколог может провести осмотр и лечение на дому либо предложить госпитализацию в стационар при тяжелых симптомах. Главный принцип работы — безопасность человека, анонимность обращения, индивидуальный подбор лекарственных средств и постоянный контроль самочувствия. Врач учитывает количество выпитого, длительность запоя, возраст, наличие хронических заболеваний, показатели давления, пульс, особенности психики и предыдущий опыт лечения алкоголизма.
    Дополнительная информация – https://3.vyvod-iz-zapoya-reutov4.ru/

  14. Reading this slowly to give it the attention it deserved, and a stop at jetstreammart earned the same slow read, choosing to read slowly is a small act of respect for content quality and very few sites earn that respect from me but this one did so without any explicit ask which is the cleanest way.

  15. Started taking notes about halfway through because the points were stacking up, and a look at boatlifebazaar added enough material that my notes file grew further, content that demands note taking from a passive reader is content with substance and the writers here are clearly producing that kind of work consistently across topics.

  16. Now feeling confident enough in this site to use it as a reference point for evaluating others on the same topic, and a look at opalvendorvault continued the comparison friendly quality, sites that serve as quality benchmarks for their topic are precious and this one has clearly become a benchmark for me on this particular subject area.

  17. AlfredJen AlfredJen

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

  18. Honest assessment after reading this twice is that it holds up under careful attention, and a look at noblevend extended that durability across more pages, content that survives a second read without revealing weak spots is rarer than the average reader probably realises and this site clearly cleared that bar.

  19. Generally I am cautious about recommending sites on first encounter but this one warrants the exception, and a look at turmerictrove reinforced the exception making, the rare site that justifies breaking my normal cautious approach is the rare site worth flagging early and this one has prompted exactly that early flagging response from me.

  20. Michaelvaw Michaelvaw

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

  21. usa android casino bonus, canadian slot machines online and usa slot machine
    categories, or android casino united states

    Here is my webpage … 90 day happily ever after blackjack (Christin)

  22. Really appreciate that the writer did not stretch the post to hit some target word count, the points end when they are made, and a stop at violetmarket reflected the same discipline, brevity is generosity in disguise and this site has clearly figured that out far better than most blog operations have.

Deixe um comentário

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