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

  1. This one is staying open in a tab for the rest of the day so I can come back and re read certain parts, and a look at detskazidleastul suggests I will be doing the same with a few more pages here too, this is going to be a deep dive over the coming hours.

  2. A piece that prompted a small mental rearrangement of how I order related ideas, and a look at 2b008099 extended that rearranging effect, content that affects the structure of my thinking rather than just adding to it is content with the deepest kind of impact and this site is reaching that depth for me today.

  3. A piece that did not require external context to follow, and a look at strategylogic maintained the same self contained quality, content that stands alone without forcing readers to chase prerequisites is more accessible and this site has clearly thought about how each piece can serve a fresh visitor rather than only existing members.

  4. Reading this confirmed a hunch I had been carrying about the topic without having articulated it, and a stop at zil2vem5 extended the confirmation, content that gives shape to fuzzy intuitions is doing the rare work of making private thoughts public and this site is providing that articulating service consistently for me lately.

  5. Stands out for actually being useful instead of just being long, and a look at opencarnivore 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.

  6. Reading this prompted me to send the link to two different people for two different reasons, and a stop at strategylogic provided ammunition for a third share, content that suits multiple audiences without being generic enough to be useless to any of them is genuinely valuable and this site has that multi audience quality clearly.

  7. Very nice post. I just stumbled upon your blog and wanted to say that I’ve really enjoyed browsing your blog posts. In any case I’ll be subscribing to your rss feed and I hope you write again soon!

  8. Honest reaction is that I want to send this to a friend who would benefit from it, and a look at hjshu added more material I will pass along too, the impulse to share is the strongest signal I have for content quality and this site is generating that impulse cleanly across multiple posts.

  9. JasonOrets JasonOrets

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

  10. Excellent post, balanced and well organised without showing off, and a stop at askoloznice continued in that same vein, this site has clearly figured out the formula for content that works for readers rather than for search engine ranking signals which is harder than it sounds today and worth real recognition from anyone.

  11. Now adding a small note in my reading log that this site is one to watch, and a look at berrybalsillie reinforced the watch status, the few sites I track deliberately rather than encounter accidentally are sites I expect ongoing returns from and this one has cleared the bar for that elevated tracking based on what I read.

  12. Melvinmah Melvinmah

    Мы рассмотрим современные вызовы здравоохранения и пути их решения с помощью технологий и научных исследований. В статье собраны данные о новых лекарствах, методах диагностики и системном подходе к улучшению здоровья населения.
    Лучшее решение — прямо здесь – частный нарколог на дом быстро

  13. Solid value for anyone willing to read carefully, and a look at flaxcargo 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.

  14. The pacing of the post was just right, never rushed and never dragged out unnecessarily, and a look at beefsteaka maintained the same rhythm, you can tell the writer has experience because the difficult skill of pacing is something only practiced writers manage to handle well in long form content over time and across formats.

  15. Bookmarked the page and the homepage too because clearly there is more to explore here, and a quick stop at wwrqeqesrdtdccgsc only made that more obvious, this is the kind of place I want to dig through over a weekend rather than rushing through during a coffee break tomorrow morning before getting back to work.

  16. Now feeling slightly more optimistic about the state of independent writing online, and a stop at canyonharborvendorhall extended that quiet optimism, sites like this one are the reason I have not given up on the open web entirely and finding them occasionally renews the case for paying attention to non algorithmic content sources today.

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

  18. Quality you can feel from the first paragraph, the writer clearly knows the topic and how to share it, and a quick look at beefsteaka confirmed the same depth runs throughout the rest of the site as well which is rare and worth pointing out when it happens online for any reader passing through.

  19. Appreciated the way each section connected smoothly to the next without abrupt jumps, and a stop at galafactors kept that flow going nicely, transitions are something most blog writers ignore but the difference is huge for the reader who is trying to follow a sustained line of thought today across many different topics.

  20. Taking the time to read carefully here has been worthwhile for the past hour, and a look at howtre extended the worthwhile reading, the calculation of return on reading time spent is something I do informally and this site has been producing positive returns across multiple sessions during the last week of regular visits and reads.

  21. Worth pointing out that the writer made the topic feel more interesting than I had been expecting, and a look at qqqb continued that elevation effect, content that improves the apparent quality of its subject through skilled treatment is doing something real and this site has clearly developed that kind of editorial alchemy throughout.

  22. Top notch writing, every paragraph carries weight and nothing feels like filler, and a stop at growthpathway reflected that same care, a rare thing on the open web these days where most pages exist for clicks rather than actual reader value or anything close to that which is honestly a real shame.

  23. Decent post that improved my afternoon a small amount, and a look at xiaoxi02 added a bit more to that, sometimes the small wins online add up over time and a useful site like this one is the kind of place that contributes consistently to those small wins for me lately across many different topics I follow.

  24. Glad I gave this a chance instead of bouncing on the headline, and after qqqb I was certain I had made the right call, snap judgements based on titles miss a lot of good content and this is a reminder to slow down and check things out before scrolling past in a hurry.

  25. Reading this triggered a small change in how I think about the topic going forward, and a stop at sddy80 reinforced that subtle shift, the rare content that actually moves my thinking rather than just confirming or filling it is the kind I most value and this site is providing that kind of impact today.

  26. Now feeling slightly more optimistic about the state of independent writing online, and a stop at nabytekidea extended that quiet optimism, sites like this one are the reason I have not given up on the open web entirely and finding them occasionally renews the case for paying attention to non algorithmic content sources today.

  27. Now noticing the careful balance the post struck between confidence and humility, and a stop at sddy80 maintained the same balance, finding the line between asserting and admitting is hard and this site has clearly developed the calibration to walk that line consistently which produces a more persuasive reading experience for me.

  28. Reading this in segments because the day was busy, and the post survived the fragmented attention well, and a stop at pujckanarekonstrukci held up similarly under interrupted reading, content that can withstand modern distracted reading patterns rather than requiring a perfect block of focused time is increasingly the kind I prefer.

  29. В общем, решил поделиться — как нормально отправлять деньги для международных переводов. На одном форуме вычитал — обязательно гляньте этот источник: денежный перевод с россии денежный перевод с россии Если по делу, то — есть реальные подводные камни. Согласитесь любой перевод за границу онлайн — это лотерея с банковскими процентами. Обратите внимание — перед финальным кликом проверьте актуальные отзывы. В противном случае легко переплатить в два раза. Моё мнение — не поленитесь проверить информацию перед отправкой.

  30. Most blog writing on this subject reaches for the same handful of arguments and this post avoided them, and a look at alitanwir continued the original treatment, content that finds its own path through territory other writers have flattened is content with real authorial energy and this site has plenty of that distinctive energy.

  31. Now adding this to a list of sites I want to see flourish, and a stop at focusignition 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.

  32. Liked everything about the experience, from the opening through to the closing notes, and a stop at flaxdune 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.

  33. Now feeling confident enough in this site to use it as a reference point for evaluating others on the same topic, and a look at webpic continued the comparison friendly quality, sites that serve as quality benchmarks for their topic are precious and this one has clearly become a benchmark for me on this particular subject area.

  34. Vague feelings of recognition kept surfacing as I read because the writing names things I have been thinking, and a look at hanbo65 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.

  35. Felt like I was reading something written by someone who actually thinks about the topic rather than reciting it, and a look at zh-movies reinforced that impression, the difference between recited content and considered content is huge and this site clearly belongs to the latter category which I appreciate as a careful reader looking for substance.

  36. Thanks for the practical examples scattered through the post rather than abstract theory only, and a look at cp38l continued that grounded style, abstract points are easier to remember when paired with concrete situations and the writers here clearly understand how readers actually retain information from blog content reading sessions.

  37. Honestly impressed, did not expect to find this level of care on the topic, and a stop at myzb79 cemented the impression, you can tell within the first few paragraphs whether a site is going to be worth the time and this one delivered on that early promise nicely throughout the rest of what I read.

  38. Thank you for keeping the writing honest and the points easy to verify against your own experience, and a stop at pujckapropodnikatele reflected the same approach, no exaggeration just steady useful content that I can take with me into my own work without second guessing every sentence I happen to read here.

  39. However casually I came to this site I have ended up reading carefully, and a look at woodbrooktradingfoundry continued earning that careful reading, the conversion from casual visitor to careful reader is something content earns rather than demands and this site has accomplished that conversion for me over the course of just a few pieces.

  40. A genuine compliment to the writer for keeping the post focused on what mattered, and a look at 54815485 continued that disciplined focus, focus is a editorial choice that compounds across many small decisions and this site has clearly made those small decisions consistently across what I have read so far this week here.

  41. Going to share this with a friend who has been asking the same questions for a while now, and a stop at agnostica added a few more pages I will pass along too, this is the kind of generous information that earns a small thank you from me right now and again later this week.

  42. Thank you for not assuming the reader already knows everything, the explanations meet me where I am, and a look at unibotz did the same, that consideration is what makes a site feel welcoming rather than gatekeepy which is sadly the default mood across the modern web today for most subjects covered.

Deixe um comentário

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