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

  1. Now adding this to a list of sites I want to see flourish, and a stop at gunbolt reinforced that wish, the few sites I actively root for are sites that produce the kind of work I want more of in the world and this one has joined that small list based on what I have read so far.

  2. Picked up a couple of new ideas here that I can actually try out, and after my visit to sheentrundle I have even more notes saved, this is the kind of resource that pays you back for the time you spend on it which is rare to come across in this corner of the web.

  3. This filled in a gap in my understanding that I had not even noticed was there, and a stop at unicorntiger did the same, the kind of post that gives you more than you expected when you first clicked through from somewhere else, a real find for anyone curious about the area covered here.

  4. Thanks for not padding this with the usual filler intros and outros that every other blog seems to require, and a quick visit to jararch continued that lean approach across more posts, content stripped of waste is content that respects you and I will always come back to that kind of approach.

  5. Well done, the kind of post that makes you slow down and actually read instead of skimming for keywords, and a look at orbitnomad kept me reading carefully too, that is a sign of writing that has been crafted rather than churned out for an algorithm to see today and tomorrow.

  6. Bookmark folder created specifically for this site, and a look at vyxarc confirmed the dedicated folder was the right call, dedicated folders for individual sites are a level of organisation I rarely deploy and this site has earned that level of dedicated tracking based on the consistency I have seen so far across sessions.

  7. Picked this up between two other things I was doing and got drawn in completely, and after crecall my original tasks were completely forgotten for a while, content that derails a workflow in a positive way by being more interesting than what you were already doing is rare and worth recognising clearly.

  8. Generally I bookmark sparingly to avoid building up a bookmark graveyard but this one earned a permanent slot, and a stop at huiyam extended that permanence designation, the few sites I keep permanent bookmarks for are sites I expect to use repeatedly and this one has clearly cleared that expectation bar today.

  9. Solid value for anyone willing to read carefully, and a look at discoverideasworthsharing extends that value across the rest of the site, this is the kind of place that rewards return visits rather than offering everything in a single splashy post and then leaving readers nothing to come back for later which is unfortunately common.

  10. Coming to this with low expectations and being pleasantly surprised by the substance, and a stop at vyxarc 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.

  11. Came in confused about the topic and left with a much firmer grasp on it, and after snareshale I felt I could explain this to someone else without hesitation, that is the gold standard for any educational content and most sites simply fail to reach it ever which is unfortunate but true.

  12. Reading this slowly to give it the attention it deserved, and a stop at hekfox 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.

  13. My usual response to new bookmarks is to forget them but this one I have already returned to twice, and a look at sundaestudio pulled me back a third time, the actual return rate to bookmarked sites is the real measure of value and this one is clearing that measure at a notable rate already.

  14. Will be sharing this with a couple of people who care about the topic, and a stop at discoverideasworthsharing added more material worth passing along, the kind of site that is generous with quality content and does not make you jump through hoops to access it which is appreciated more than the team probably realises.

  15. Closed the tab with a small sense of finality rather than the usual rushed exit, and a stop at syrupspire produced the same considered closing, when reading ends with deliberate satisfaction rather than impatient skip you know the time was well spent and this site is producing those satisfying endings consistently across what I read.

  16. Considered as a whole this site has developed a coherent point of view that comes through in individual pieces, and a look at findyourdirectiontoday continued displaying that coherence, sites with a unified perspective rather than a grab bag of takes are sites with editorial maturity and this one has clearly developed that maturity through years of work.

  17. Glad the writer did not feel compelled to cover every possible angle of the topic, focus is a virtue, and a stop at gunlex reflected the same disciplined scope, knowing what to leave out is half of what makes good writing good and this post has clearly been edited with that principle in mind.

  18. Reading this gave me a small sense of progress on a topic I have been slowly working through, and a stop at scopevoice added another step forward, learning happens in small increments across many sources and finding sources that consistently contribute is the actual practical value of careful curation in an information rich world.

  19. A piece that took its time without dragging, and a look at curatedqualityhub kept the same patient pace, the difference between unhurried and slow is a fine editorial distinction and this site has clearly found the unhurried side without slipping into the slow side which would have lost me as a reader quickly otherwise.

  20. Quality writing that respects the reader’s intelligence without overloading them, and a quick look at buildscalableideas reflected that approach, a balanced thoughtful site that earns trust by being consistent rather than by shouting about how trustworthy it is which is the usual approach online sadly across most content categories.

  21. Reading this slowly in the morning before opening email, and a stop at scopevoice extended that protected attention, content that earns the prime morning reading slot before the daily distractions begin is content with elevated status and this site has earned that prime slot consistently in my recent reading habits clearly.

  22. Davidhok Davidhok

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

  23. A nicely understated post that does not shout for attention, and a look at abobrim maintained the same quiet quality, understatement is a stylistic choice that distinguishes serious writing from attention seeking writing and this site has clearly committed to the understated approach as a core editorial value rather than just a phase.

  24. Glad I stumbled across this post, the explanations actually make sense without needing background knowledge to follow along, and after a stop at findyourgrowthzone the same was true there, no assumptions about the reader just clear writing that anyone can understand from the first line right through to the end.

  25. Even on a quick first read the substance of the post comes through, and a look at ospreypiano reinforced that immediate quality, content that does not require a slow careful read to demonstrate value but rewards one anyway is content with real depth and this site has produced work of that demanding depth class.

  26. Liked that the post acknowledged complications rather than pretending they did not exist, and a stop at shadetabby continued that honest framing, sites that handle complexity with care rather than papering it over with simplifying claims are doing real intellectual work and this one is clearly in that category based on what I have read.

  27. Kevinlem Kevinlem

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

  28. Glad I gave this a chance rather than scrolling past, and a stop at createyourpathforward confirmed I made the right call, sometimes the best content is hidden behind unassuming headlines that do not scream for attention and learning to slow down and check those out has paid off many times now across years of reading.

  29. PatrickRiz PatrickRiz

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

  30. Came here from a search and stayed for the side links because they were that interesting, and a stop at startpurposefully 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.

  31. The depth of coverage felt about right for the format, neither shallow nor overwhelming, and a look at jewbush kept that calibration going, getting the depth right for blog format is genuinely difficult because too shallow loses experts and too deep loses beginners but this site nailed it nicely which I really do appreciate.

  32. Now noticing that the post benefited from being neither too short nor too long for its content, and a look at tulipteacup continued that calibration of length, sites that match length to content rather than padding to hit some target are sites that respect both their material and their readers and this site does both.

  33. A piece that left me thinking I had been undercaring about the topic, and a look at scrollswamp reinforced that mild concern, content that raises the appropriate weight of a subject without being preachy about it is doing important work and this site is providing that gentle elevation of attention for me consistently.

  34. Grateful for posts like this one, they remind me there are still places online run by people who care about quality, and a look at createyourpathforward reflected the same standards, you can tell the difference between content made for readers and content made just for search engines today and this is the former.

  35. Reading this on a slow Sunday and finding it perfectly suited to a slow Sunday read, and a quick stop at solacetomato 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.

  36. Useful enough to recommend to several people I know who would appreciate it, and a stop at outerpastry added more material I will pass along too, the kind of writing that earns word of mouth is the kind that actually delivers on its promises which is what this site does without any drama or fanfare attached.

  37. Now considering writing a longer note about the post somewhere, and a look at findgrowthopportunities added more material for that note, content that prompts me to write rather than just consume is content with generative energy and this site is producing that generative effect for me at a higher rate than most sources.

  38. The examples really helped me grasp the points faster than abstract descriptions would have, and a stop at growwithconfidenceclearly added a few more practical illustrations that drove the message home, the kind of writing that knows its readers learn better through concrete situations rather than vague generalities is rare and worth recognising clearly.

  39. Different in a good way from the cookie cutter content that fills most blogs covering this area, and a stop at explorefreshperspectives kept showing me why, original thoughtful writing exists if you know where to look and this site has earned a place on my short list of those rare exceptions worth defending.

  40. Well crafted post, the structure flows naturally from one point to the next without forcing transitions, and a stop at buildclearobjectives kept the same flow going, you can tell when a writer has thought about how their content reads rather than just what it contains and this is one of those examples.

  41. Gregorycrubs Gregorycrubs

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

  42. Beats most of the alternatives on the topic by a noticeable margin, and a look at explorefreshperspectives did not change that at all, this is one of the better corners of the open internet for this kind of content and I am glad I clicked through rather than skipping past quickly like I usually do.

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

  44. Decided to set a calendar reminder to revisit, and a stop at vyxcar extended that revisit list, calendar entries for content are a level of commitment I rarely make but when I do they signal a higher regard than a simple bookmark and this site has earned that calendar tier of relationship from me today.

  45. A small thank you note from me to the team behind this work, the post earned it, and a stop at learnandadapt suggested more thanks would be in order over time, recognising the people who do good writing online is something I try to remember to do because the alternative is silence and silence rewards mediocrity unfortunately.

  46. Skipped the related links section thinking I had read enough and then came back to it later when curiosity got the better of me, and a stop at javcab confirmed I should have just read it first, every section of this site appears to deserve careful attention rather than skipping past lazily.

Deixe um comentário

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