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

  1. Beyler dinleyin Canlı destek yok, oranlar düşük, her şey çok kötüydü Ama sonunda bu siteyi keşfettim — 1xbet güncel adres tıkla Müşteri desteği 7/24 aktif Kısacası, kaydet kenarda dursun — 1xbet giriş 1xbet giriş Sakın sahte sitelere kanma Bahis yapan herkese yolla

  2. Liked the balance between depth and brevity, never too shallow and never too long, and a stop at clarityenablestraction 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.

  3. If I were grading sites on this topic this one would receive high marks, and a stop at bondedvisions continued earning those high marks, the informal grading I do mentally for content sources is something I take seriously even though it is informal and this site has been receiving consistent high marks across multiple sessions today.

  4. Really nice to see things explained without overcomplicating the topic, the words flow naturally and stay easy to follow, and a short visit to growthcraft only added to that experience because the same simple approach is used across the rest of the page too without any change in tone.

  5. Liked the careful word choice throughout, every term seemed picked for a reason rather than thrown in casually, and a stop at claritycreatesflow continued that precise style, this kind of attention to small details is what separates careful writing from the usual rushed content that dominates blog spaces today across pretty much every topic I follow.

  6. Diegopug Diegopug

    Вывод из запоя в Казани на дому и в клинике: врач-нарколог, капельница, детоксикация, лечение алкоголизма, кодирование, реабилитация. Круглосуточная помощь анонимно.
    Подробнее можно узнать тут – нарколог на дом вывод из запоя в казани

  7. В экстренных ситуациях, когда состояние больного стремительно ухудшается, а промедление грозит серьёзными осложнениями, наши специалисты готовы немедленно оказать следующую помощь. Лечение запоя — одна из самых востребованных услуг наркологической клиники, и мы оказываем её в любое время суток. Если ваш близкий сильно страдает, не ждите — скорая помощь приедет быстро, а консультацию можно получить бесплатно по телефону.
    Изучить вопрос глубже – http://narkologicheskaya-klinika-moskva13.ru

  8. A piece that handled the topic with appropriate weight without becoming portentous, and a look at trustcircle 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.

  9. Reading this on a slow Sunday and finding it perfectly suited to a slow Sunday read, and a quick stop at kavqaro kept the same gentle pace, content that fits the mood of the moment is something I notice and remember and this site has the kind of pace that suits relaxed reading sessions especially well.

  10. Liked everything about the experience, from the opening through to the closing notes, and a stop at growthunlockedforward extended that into more pages, finding a site where the editorial vision shows through every choice rather than feeling random is an increasingly rare experience and one I am glad to have today during this particular reading session.

  11. High quality writing, no marketing speak and no buzzwords that mean nothing, and a stop at growthmovesclearly kept that going, simple direct content that actually communicates something is harder to find than it should be and this is one of the rare places that gets it right consistently across many different posts.

  12. Vague feelings of recognition kept surfacing as I read because the writing names things I have been thinking, and a look at trustbonded produced more of those recognition moments, content that gives shape to private intuitions is content that makes me feel less alone in my own thinking and this site has that effect.

  13. Really clear writing, the kind that makes you want to share the link with someone who has been asking about the topic, and a quick browse through capitalbondworks only made me more sure of that, the information here stays useful long after the first read is done which says a lot.

  14. Genuinely glad I clicked through to read this rather than skipping past, and a stop at claritystrategy 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.

  15. Found something new in here that I had not seen explained this way before, and a quick stop at visionengine expanded the idea even further, the kind of writing that nudges your thinking forward a bit without forcing the issue is exactly what I look for online today and rarely actually find anywhere.

  16. Слушайте кто играет А поддержка молчит как рыба Нервов потратил — мама не горюй Короче, единственное где не кидают — вавада казино онлайн лучший выбор Поддержка отвечает сразу В общем, вся инфа вот здесь — vavada online casino vavada online casino Не ведитесь на лохотроны Перешлите тому кто тоже ищет нормальное казино

  17. Всем привет из интернета Задолбался я уже искать нормальное казино Нервов потратил — мама не горюй Короче, единственное где не кидают — vavada официальный сайт Фриспины и акции каждый день В общем, смотрите сами по ссылке — vavada казино vavada казино Только вавада реально рулит Перешлите тому кто тоже ищет нормальное казино

  18. My reading list is short and selective and this site is now on it, and a stop at strategyalignment confirmed the placement, the short list of sites I read deliberately rather than encounter accidentally is something I curate carefully and adding to it is a real act of trust which this site has earned today.

  19. Came here from a search and stayed for the side links because they were that interesting, and a stop at directionguidesaction took me even further into the site, the kind of organic exploration that good content invites is something most sites kill through aggressive interlinking and pushy navigation choices rather than relying on quality.

  20. Decided to set aside time later to read more carefully, and a stop at momentumshift reinforced that decision, content that earns a calendar entry rather than just a passing read is in a different tier altogether and this site is clearly working at that elevated level which I really do appreciate as a reader today.

  21. StevenExcum StevenExcum

    We advise you to save п»їhttps://nathealth.casa/# to save money later.

  22. Took me back a step or two on an assumption I had been making, and a stop at motionstrategy 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. Felt the post had been quietly polished rather than aggressively styled, and a look at clovebow confirmed the same understated polish, sites whose quality reveals itself slowly rather than announcing itself loudly are the kind I trust more deeply because the trust is not based on first impressions of marketing but actual substance.

  24. Stands out for actually being useful instead of just being long, and a look at progresswithclaritynow kept that going, length without value is the default mode of most blogs these days but this site has clearly chosen a different path which I respect a lot as a reader who values careful editing decisions like that.

Deixe um comentário

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