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.026 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.

  25. A piece that was confident enough to leave some questions open rather than forcing closure, and a look at sharedpath continued that intellectual honesty, content that admits the limits of its scope is more trustworthy than content that pretends to total understanding and this site has the right calibration on certainty consistently.

  26. Great work on keeping things readable, the post never drags or repeats itself which I really appreciate, and a stop at focuslane added a bit more context that fit naturally with what was already said here, no need to read everything twice to get the point being made today.

  27. Appreciate the practical examples, they made the abstract points easier to grasp, and a stop at progresssystem added more of the same, this site clearly understands that real examples beat empty theory every single time which is the mark of a writer who knows their audience well and respects their time.

  28. Reading this in the morning set a good tone for the day, and a quick visit to clarityconstructor kept that good tone going, content can do that sometimes when it hits the right notes and finding sites that consistently strike that tone is something I have learned to recognise and reward with regular visits.

  29. Now noticing that the post never raised its voice even when making a strong point, and a look at growthmoveswithsignal continued that calm volume, content that can make important points without resorting to typographic emphasis or emotional appeal is content that trusts its substance to do the work and this site has that confidence consistently.

  30. Solid value packed into a relatively short post, that takes skill, and a look at capitalheritage continues the dense useful content across more pages, this site clearly understands that respecting reader time is itself a form of generosity which is something most blog operations seem to have forgotten lately across the wider open web.

  31. Nice and clean, that is the best way to describe the writing here, no clutter and no wasted words, and a quick visit to smartgrowth kept that going, I appreciate when a site treats its readers like people who can think for themselves without needing constant hand holding through every paragraph.

  32. Glad to have another data point on a question I am still thinking through, and a look at steadfastlink added two more, content that acknowledges its place in a wider conversation rather than pretending to settle the question alone is intellectually honest in a way that I wish was more common across the open web.

  33. Thanks for keeping the writing direct without losing the warmth that makes content feel human, and a stop at bluechipbonding carried both qualities forward, balancing professionalism and personality is a rare skill and the writers here have clearly figured out how to consistently land it across many posts which I notice.

Deixe um comentário

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