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.

6.795 Comentários

  1. Decided not to skim despite my usual habit and was rewarded for the discipline, and a stop at chctw earned the same patient approach, training myself to recognise sites that warrant slower reading is part of being a careful online reader and this site is the kind that helps me practice that skill regularly.

  2. A piece that brought a sense of order to a topic I had been finding chaotic, and a look at nebankovnipujckabezdolozeniprijmu continued that organising effect, content that imposes useful structure on messy subjects is doing genuine intellectual work and this site is providing that organisational function across multiple posts I have read recently here.

  3. If I am being honest this is the kind of site I quietly hope my own work will someday resemble, and a stop at harktobkf extended that aspirational feeling, finding work that models what I want to produce is part of why I read carefully and this site has been performing that modelling function for me lately consistently.

  4. Saving this link for the next time someone asks me about this topic, and a look at imprumutprovidentfaracartemunca expanded what I will be sharing with them, this is the kind of resource that makes a real difference when you are trying to point a friend to something useful and reliable rather than generic marketing pages.

  5. Glad I stumbled across this post, the explanations actually make sense without needing background knowledge to follow along, and after a stop at daythi 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.

  6. Now considering carefully how to share this site with the right audience rather than broadcasting widely, and a look at nerodev extended that careful sharing impulse, content worth sharing carefully rather than spamming is content that has earned a higher kind of recommendation and this site has earned that careful shareability throughout pieces.

  7. Came here from another site and ended up exploring much further than I planned, and a look at s0021 only encouraged more exploration, the kind of place where one click leads to another not through manipulative design but through genuinely interesting content is rare and worth highlighting when found like this somewhere on the open internet.

  8. Now I want to find more sites like this but I suspect they are rare, and a look at bowdena extended that thought, the few sites that meet this quality bar are precious specifically because they are rare and finding others like them is one of the ongoing projects of careful internet curation across the years.

  9. Really appreciate the absence of stock photos that have nothing to do with the content, and a quick visit to hvyq maintained the same restraint, visual filler is a tell that the writing cannot stand on its own and the lack of it here suggests the team has confidence in their content quality alone.

  10. Знаете, — как найти адекватный способ перевода денег за границу онлайн. Наткнулся случайно в обсуждении вот этот источник: оплата через посредника за рубеж оплата через посредника за рубеж Главное, что нужно понять — есть скрытые подводные камни. Да и сами понимаете такая транзакция — это риск переплатить в два раза. Кстати, — перед тем как отправлять почитайте свежие отзывы. В противном случае легко пролететь с курсом. Как по мне — стоит разобраться заранее.

  11. Loved the writing voice here, friendly without being fake and confident without being arrogant, and a stop at woodcovecommerceatelier carried the same tone forward, the kind of personality that makes a reader feel welcome rather than lectured at which is a balance plenty of writers struggle to find no matter how long they have been at it.

  12. If I am being honest this is the kind of site I quietly hope my own work will someday resemble, and a stop at harktobkf extended that aspirational feeling, finding work that models what I want to produce is part of why I read carefully and this site has been performing that modelling function for me lately consistently.

  13. Quality writing that respects the reader’s intelligence without overloading them, and a quick look at christmastidea 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.

  14. Sets a higher bar than most of what shows up in search results for this topic, and a look at rohovykancelarskystul did not lower that bar at all, in fact it confirmed the impression, this is the kind of consistency that earns a place in regular rotation for serious readers instead of casual scrollers passing through.

  15. Решил проблему только когда наткнулся — как выбрать реально работающий способ для международных платежей. Случайно набрел на годный материал: международный платежный агент https://mezhdunarodnye-platezhi-kap.ru Суть вот в чём — скрытые платежи всплывают в последний момент. Ну сами подумайте любой подобный трансграничный платёж — это реальная финансовая лотерея. Вот ещё важный момент — перед финальным подтверждением сравните эффективный курс. Без этого легко попасть на лишние траты. Как итог — лучше один раз изучить тему перед любой отправкой.

  16. Beyond the immediate post itself the editorial sensibility behind the site is what struck me, and a stop at nerodev continued displaying that sensibility, content that reveals editorial choices through accumulated reading is content with structural quality and this site has clearly developed an underlying approach worth identifying through multiple sessions of reading.

  17. Without overstating it this is a quietly excellent post, and a look at xbt15h extended that quiet excellence, content that earns superlatives without demanding them through marketing language is content that has truly earned them through the substance and this site has clearly produced work in that earned excellence category today.

  18. Just want to say thank you for putting this together, posts like these make searching online actually worth it sometimes, and a quick look at bowdena kept that going, useful and easy to read without any of the tricks that ruin most blog comment sections lately on the wider open web.

  19. I appreciate the clarity here, everything is explained in simple terms without unnecessary detail, and after a quick stop at christmastidea the points came together nicely for me, the writing keeps things straightforward and respects the reader from start to finish without ever talking down to anyone.

  20. Now wondering how the writers calibrated the level of detail so well, and a stop at rohovykancelarskystul continued the same calibration, the right level of detail is one of the harder editorial calls in any piece and this site has clearly developed an instinct for it through what I assume is years of careful practice publicly.

  21. Solid stuff, the kind of post that I will probably refer back to later this month when the topic comes up again, and a look at xbt15h only confirmed I should bookmark the site as a whole rather than just this single page for future reference and use across coming weeks.

  22. Bookmark folder created specifically for this site, and a look at flaxgourd 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.

  23. Excellent execution from start to finish, the post never loses its rhythm and the points stay sharp, and a quick stop at claritybuilder kept the same level going, consistency like this across a site is the marker of a serious operation rather than a casual side project running on autopilot somewhere else.

  24. Reading this triggered a small reorganisation of my own thinking on the topic, and a stop at actionorchestration furthered that reorganisation, content that affects the shape of my mental model rather than just decorating it with new facts is content with structural rather than informational impact and this site provides that.

  25. Saving this link for the next time someone asks me about this topic, and a look at seleranona88 expanded what I will be sharing with them, this is the kind of resource that makes a real difference when you are trying to point a friend to something useful and reliable rather than generic marketing pages.

  26. Glad to have another data point on a question I am still thinking through, and a look at busan-massage3 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.

  27. J’ai essayé plusieurs sites mais rien n’y faisait. Télécharger un fichier sûr était devenu un vrai casse-tête. Après avoir suivi les étapes dans le bon ordre, tout a fonctionné. J’ai finalement trouvé la bonne source et je voulais vous partager tous les détails, vous pouvez consulter les informations à jour ici: télécharger 1xbet inscription https://www.mameauto.com. Bref, ce que je voulais dire — l’application mobile fonctionne parfaitement bien.

    l’installation était simple et rapide, pas de souci à vous faire. J’ai testé plusieurs apps mais celle-ci est la meilleure — ne perdez plus votre temps ailleurs. Bon courage à tous…

  28. Felt the writer was speaking my language without trying to imitate it, and a look at adverbsa continued that natural fit, when a writers default voice happens to match what you find easy to read the experience feels frictionless and that is something I notice and remember about specific sites going forward.

  29. Stayed longer than planned because each section earned the next, and a look at seleranona88 kept that pulling effect going across more pages, the kind of subtle pull that good writing exerts on attention is something I find harder and harder to resist when I encounter it on the open web today.

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

  31. Now feeling mildly impressed in a way I do not quite remember feeling about a blog in a while, and a stop at busan-massage3 extended that mild impression, content that produces specific positive emotional responses rather than just neutral information transfer is content with extra dimensions and this site has those extra dimensions clearly.

  32. If a friend asked me where to read carefully on the topic I would send them here without hesitation, and a look at beaconaster confirmed the recommendation strength, the directness of my recommendation reflects how confident I am in the quality and this site has earned undiluted recommendations from me across multiple recent conversations actually.

  33. Skipped to a specific section because I knew that was the question I had, and the answer was clean, and a stop at 6rtpibisawin similarly delivered targeted answers without burying them, content engineered for readers who arrive with specific needs rather than open ended browsing is increasingly valuable in a search heavy reading environment.

  34. A piece that read as the work of someone who reads carefully themselves, and a look at oliveorchardgoodsroom continued that informed feel, writers who are also serious readers produce work with a different quality and this site reads as the product of someone steeped in good writing rather than just generating content for an audience.

  35. Now noticing that the post benefited from being neither too short nor too long for its content, and a look at adverbsa 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.

  36. Thanks for laying this out in a way that someone newer to the topic can follow, and a stop at minnesotarocks kept that accessibility going, writing that meets readers at different experience levels without condescending is hard to do well and the writers here have clearly thought about who they are writing for.

  37. Without overstating it this is a quietly excellent post, and a look at sandbetgacor extended that quiet excellence, content that earns superlatives without demanding them through marketing language is content that has truly earned them through the substance and this site has clearly produced work in that earned excellence category today.

  38. Reading this with my morning coffee turned into reading the related posts with my morning coffee, and a stop at jualpurehopeoil stretched the morning further, content that pulls breakfast into a reading session rather than just accompanying it is content that has earned a higher claim on my attention than the average article does.

  39. Honestly enjoyed not being sold anything for the entire duration of the post, and a look at loopconcepts kept that pleasant absence going across more pages, content that exists for its own sake rather than as a funnel to a paid product is increasingly rare and worth supporting where I can find it.

  40. Reading this prompted me to dig into a related topic later, and a stop at 2b808805 provided some of the starting points for that follow up reading, content that triggers further exploration rather than satisfying curiosity completely is content with real generative energy and this site has plenty of that energy throughout it.

  41. Well done, the writing is professional without being stiff, and the topic is treated with care, and a look at sandbetgacor reflected that approach, the kind of site I would point a colleague to if they asked for a reliable starting point on this topic in the future without any hesitation at all.

  42. A piece that read smoothly because the writer understood how readers actually move through prose, and a look at commentariesa maintained the same reader awareness, writers who think about the reading experience as much as the writing experience produce better work and this site has clearly made that shift in editorial approach.

Deixe um comentário

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