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

  1. Bookmark added without hesitation after finishing, and a look at softorchard confirmed I should bookmark the homepage too rather than just this page, the rare site that earns category level trust rather than just single article approval is the kind I want to rely on across many different topics over time.

  2. Now noticing that the post avoided the temptation to be funny in places where humour would have undermined the substance, and a stop at blog33public maintained the same restraint, knowing when to be serious is a rare editorial virtue and this site has clearly developed it through what I assume is careful editorial practice over years.

  3. Time spent here today felt productive in the way that good reading sessions sometimes do, and a stop at blog33public extended that productive feeling across the rest of the morning, the difference between productive reading and merely passing time is real and this site is consistently on the productive side for me lately.

  4. Felt the writer respected the topic without being precious about it, and a look at blog66civil continued that respectful but unfussy treatment, finding the right register for serious topics is hard and this site has clearly figured out how to take the topic seriously while still being readable for casual visitors regularly.

  5. Michaelswoda Michaelswoda

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

  6. Probably going to mention this site in a write up I am working on later this month, and a stop at utama88a provided more material for that potential mention, content worth referencing in my own published work rather than just personal reading is content with the highest endorsement level and this site has earned that endorsement.

  7. Liked that there was nothing performative about the writing, and a stop at saasselect 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. Really appreciate that the writer did not overstate the importance of the topic to make the post feel weightier, and a quick visit to devreef maintained the same modest framing, content that is honest about its own scope rather than inflating itself is the kind I trust and return to repeatedly over time.

  9. Liked the balance between depth and brevity, never too shallow and never too long, and a stop at utama88a kept the same balance going across the rest of the site, this is one of the harder skills in writing and the team here clearly has it figured out very well indeed across every page.

  10. Better than most of the writing I have come across on this topic recently, simpler and more direct, and a look at appfactor continued in that same way, a real outlier in a crowded space full of repetitive content that says little while taking up a lot of reader time today which is unfortunate.

  11. Reading carefully this time rather than scanning, and the depth shows up in places I missed first time around, and a look at halohaveny rewarded the same careful approach, content that holds up to multiple reads is content I want more of in my regular rotation rather than disposable scroll fodder daily.

  12. Michaelswoda Michaelswoda

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

  13. Manuellyday Manuellyday

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

  14. EdwardTOOFE EdwardTOOFE

    Повод обратиться в клинику возникает, когда состояние человека заметно изменилось: появились запойные периоды, болезненные попытки самостоятельно выйти из употребления, ломка, нарушения сна, повышенная возбудимость, депрессия, тревожность, проблемы с памятью и поведением. При алкогольной зависимости особенно опасны длительные запои и резкое ухудшение самочувствия. Если запой длится больше нескольких суток, а объем алкоголя в день только растет, присутствуют неадекватные реакции, срочно звоните в наркологическую клинику.
    Дополнительная информация – http://a.narkologicheskaya-klinika-v-krasnoyarske17.ru/

  15. Just sat back at the end of the post and felt grateful that someone took the time to write it, and a look at blog33night extended that gratitude across more of the site, recognising effort behind quality work is part of what makes the open web a community rather than just a marketplace today.

  16. Skipped the related products section because there was none, and a stop at tactpixel also lacked any aggressive monetisation, content that is not constantly trying to convert me into a customer or subscriber is content that has confidence in its own value and that confidence shows up as a different reading experience.

  17. GregoryNuh GregoryNuh

    Зависимость от алкоголя и наркотиков — это серьезные хронические заболевания, разрушающие физическое и психическое здоровье. Многие родственники до последнего пытаются справиться с проблемой самостоятельно, однако отсутствие своевременного лечения запоя часто приводит к тяжелым последствиям. Регулярное употребление спиртного вызывает токсические поражения всего организма, особенно страдают печень, сердце и нервная система. Огромное значение имеет срочный вызов нарколога на дом для лечения запоя и вывода из абстинентного состояния. Врач-нарколог приезжает, чтобы безопасно провести все необходимые процедуры и снизить риски для жизни. Лечение алкоголизма на дому начинается именно с такого экстренного вмешательства.
    Получить дополнительную информацию – vrach-narkolog-na-dom

  18. A thoughtful read in a week that has been mostly noisy, and a look at kodekit carried that thoughtful quality across more pages, finding pockets of considered writing in a week of distractions is one of the small wins of careful curation and this site is providing those pockets at a sustainable rate.

  19. Этот документ охватывает важные аспекты медицинской науки, сосредотачиваясь на ключевых вопросах, касающихся здоровья населения. Мы рассматриваем свежие исследования, клинические рекомендации и лучшие практики, которые помогут улучшить качество лечения и профилактики заболеваний. Читатели получат возможность углубиться в различные медицинские дисциплины.
    Получить полную информацию – Наркологическая клиника «northern-clinic.» в Санкт-Петербурге

  20. Held my interest from the opening line through to the closing thought, and a stop at everydaypurchaseplatform did the same, content that earns sustained attention in an environment full of distractions is doing something right and this site is clearly doing several things right rather than just one or two which I really appreciate.

  21. Thanks for taking the time to write this, it is clear that some thought went into how each point would land, and after I went through blog33current I had a better grip on the topic, real value without the usual marketing noise people have to put up with online when searching for answers.

  22. Took me back a step or two on an assumption I had been making, and a stop at markgonzalez 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.

  23. Люди помогите советом Ситуация критическая Жена в истерике Таблетки не помогают Короче, только это реально спасло — помощь нарколога на дому эффективно Осмотрел и поставил капельницу В общем, жмите чтобы сохранить — платный нарколог на дом платный нарколог на дом Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  24. Spent a few minutes here and came away with a clearer picture of the topic, the writing keeps things simple without dumbing them down, and after a stop at blog33current the rest of the points lined up neatly which is something I appreciate when I am short on time and need answers fast.

  25. Genuine pleasure to read, and that is not something I say often after a casual click through, and a quick visit to bondprimex kept the same feeling going across the rest of the site, finding writing that actually feels good to spend time with rather than just functional is increasingly rare on the open web.

  26. Thanks again for the post, I learned a couple of things I can actually use later this week, and after I went over datawoods the rest of the site looked equally promising, definitely going to spend more time here when I get a free moment over the weekend to read more carefully.

  27. A piece that handled the topic with appropriate weight without becoming portentous, and a look at gridcloud continued that calibrated seriousness, content that takes itself seriously without becoming pompous is something this site has clearly figured out and the balance shows up in every piece I have read across multiple sessions now.

  28. The overall feel of the post was professional without being stuffy, and a look at devsapling kept that approachable expertise going, finding the right register for technical content is hard but this site has clearly figured out how to sound knowledgeable without slipping into that distant lecturing tone that loses readers in droves every time.

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

  30. Speaking from the perspective of a fairly demanding reader the writing here clears the bar consistently, and a look at utilityview continued clearing that bar, the calibration of demanding reader is something I apply to all sources and this site has been one of the few that handles the demanding reading well across pieces sampled.

  31. Took something from this I did not expect to find, and a stop at softfactor added another unexpected useful piece, content that exceeds expectations rather than just meeting them is the kind that builds enthusiasm and earns repeat visits without any explicit ask from the writer or platform behind the work being read.

  32. Going to come back when I have more time to read carefully, the post deserves more than a quick scan, and a stop at amberapp reinforced that, this is the kind of site that rewards a slower read which is hard to find in this fast paced corner of the internet but really worthwhile.

  33. If I had encountered this site five years ago I would have been telling everyone about it, and a look at blog66market extended that retrospective enthusiasm, the version of me who used to recommend favourite blogs frequently would have made sure friends knew about this one and that earlier enthusiasm is partially returning to me here.

  34. usa online slots no deposit bonus, australian online pokies minimum $5 deposit and no deposit
    bonus slots australia, or united kingdom roulette betting strategy

    Also visit my website – casino tycoon game free download – Trey

  35. Honestly impressed by the consistency of voice across what I have read so far, and a quick visit to verasync continued that consistent feel, when a site reads like one careful person rather than a committee the experience is more rewarding for the reader who notices these subtle editorial details over time.

  36. Manuellyday Manuellyday

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

  37. top casino in canada for real money, united kingdom idol time slot and bet365
    money blackjack usa, or poker with real money usa

    Here is my web-site; do you pay tithing on gambling winnings (Lionel)

Deixe um comentário

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