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

  1. WilliamPox WilliamPox

    Этот список — памятка на холодильник. Он не раскрывает диагноз, но точно описывает поводы для связи с дежурным врачом. Своевременная эскалация — часть безопасности, а не «подстраховка». Если сомневаетесь — лучше позвонить.
    Исследовать вопрос подробнее – капельница от запоя стоимость

  2. usa casino games, online pokies united states real money paypal and $50 no deposit mobile casino new zealand, or parhaat hard rock casino table minimums – Foster, tarjousaset

  3. При поступлении вызова нарколог незамедлительно прибывает на дом для проведения детального первичного осмотра. Врач измеряет жизненно важные показатели, такие как пульс, артериальное давление и температура, а также собирает краткий анамнез, чтобы определить степень алкогольной интоксикации и сформировать индивидуальный план терапии.
    Углубиться в тему – http://vyvod-iz-zapoya-donetsk-dnr0.ru

  4. Took my time with this rather than rushing because the writing rewards attention, and after heliohive I had even more to absorb, the kind of content that pays back the patient reader rather than punishing them with empty filler is something I look for and rarely find in regular searches lately.

  5. Easy to recommend without reservations, the site delivers on every promise it implicitly makes, and a look at instainsights kept that same standard going, the kind of consistency that earns trust over time rather than chasing it through aggressive marketing is what I see here and it is appreciated greatly by this particular reader today.

  6. Frankpaild Frankpaild

    При тяжелых признаках отравления, судорогах, галлюцинациях, выраженном возбуждении, потере сознания, острой сердечной или почечной недостаточности домашнее прокапывание может быть недостаточным. В таких случаях врач оценивает необходимость госпитализации, рекомендует вызвать скорую помощь или организует транспортировку больного в стационар, где доступны расширенная диагностика, ЭКГ, анализ крови и мочи, интенсивная терапия и круглосуточное наблюдение.
    Изучить вопрос подробнее – kapelnica-ot-zapoya-chto-vhodit-v-sostav

  7. DustinPhype DustinPhype

    Цель центра — не просто убрать физическую тягу, а дать человеку шанс на новую жизнь. Здесь готовы помочь каждому, кто сделал шаг навстречу здоровью. Если вы или ваш близкий столкнулись с проблемой зависимости, не затягивайте — звоните в Наркологический центр «Наше Здоровье» в Москве прямо сейчас.
    Изучить вопрос подробнее – капельницы от наркозависимости

  8. FrankDum FrankDum

    Перед началом лечения врач-нарколог проводит прием, собирает информацию о длительности зависимости, количестве употребляемого алкоголя или наркотических веществ, предыдущих попытках бросить и наличии хронических заболеваний. При необходимости назначаются анализы и дополнительная диагностика. В сложных случаях к обследованию подключается психиатр, психолог или психотерапевт. Такой подход необходим, если у человека отмечаются бессонница, выраженная тревожность, изменения личности, депрессивные проявления, психические нарушения или последствия длительной интоксикации.
    Получить больше информации – narkologicheskaya-klinika-moskva

  9. Picked up several practical tips that I plan to try out this week, and a look at mintmarketry added a few more I will be testing alongside, content with practical hooks that connect to my actual life is the kind that earns my repeat attention rather than the merely interesting that I forget within a day.

  10. hello!,I like your writing so much! share we communicate more about your article on AOL? I require an expert on this area to solve my problem. Maybe that’s you! Looking forward to see you.

  11. LeonardBef LeonardBef

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

  12. Coming to this with low expectations and being pleasantly surprised by the substance, and a stop at supplysymphony continued exceeding expectations, the recalibration of expectations upward across multiple positive readings is one of the actual rewards of careful browsing and this site is providing that recalibration at a steady rate apparently.

  13. NormanMoogy NormanMoogy

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

  14. best online slot usa, usa friendly casino no deposit free spins 2021 and free sign up bonus
    usa bingo, or united kingdom poker slot machine online roulette
    mit 10 cent einsatz; Shelli,

  15. 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 pixelparade reflected the same discipline, brevity is generosity in disguise and this site has clearly figured that out far better than most blog operations have.

  16. Solid endorsement from me, the writing earns it, and a look at orderpad continues to earn it across the broader site too, the kind of operation that maintains quality across many pages rather than just one viral post is a sign of serious commitment and that is what I see here clearly across what I read.

  17. Thanks for the honest framing without exaggerated claims that the topic will change my life, and a stop at curioport 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.

  18. Picked this up while looking for something else and ended up reading every paragraph because it was actually informative, and after yelnix I was sure I would come back, that does not happen often when most sites bury the useful parts under endless ads and pop ups today and across most categories online.

  19. Started taking notes about halfway through because the points were stacking up, and a look at datafort 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.

  20. A piece that suggested careful editing without showing the marks of the editing, and a look at spruceandstyle continued that invisible polish, the best editing disappears into the prose and this site reads as having been edited with skill that does not announce itself which is the highest compliment I can offer any blog content.

  21. Reading this felt productive in a way most internet reading does not, and a look at westvendor continued that productive feeling, sometimes the open web feels like a waste of time but sites like this remind me why I still bother to look around rather than retreating to old reliable sources for everything I need.

  22. Pass this along to anyone you know dealing with similar questions, the answers here are clear, and a stop at irvanta adds even more useful material, this is the kind of resource that deserves to circulate widely rather than getting lost in the constant churn of new content online that buries good work daily.

Deixe um comentário

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