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.

5.789 Comentários

  1. Louielar Louielar

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

  2. Came in expecting another generic take and got something with actual character instead, and a look at startclearthinking carried that personality forward, finding a distinct voice on a saturated topic is impressive and worth pointing out when it happens because most sites end up sounding identical to their nearest competitors quickly.

  3. WayneDah WayneDah

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

  4. Ended up here on a wandering afternoon and was glad I stayed for the read, and a stop at ixaqua extended the wandering into a proper exploration of the site, the kind of place that rewards aimless clicking with something genuinely interesting rather than the shallow content that mostly populates the modern open web.

  5. Anyone curious about this topic would do well to start here, the foundation laid is solid, and a stop at discoverbetterchoices would round out their understanding nicely, this is the kind of resource I would point a friend toward without hesitation if they asked me where to begin learning about anything in this area.

  6. AllenFaw AllenFaw

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

  7. Stayed longer than planned because each section earned the next, and a look at arobell 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.

  8. ElwoodNug ElwoodNug

    В этой статье мы говорим о важности поддержки в процессе выздоровления. Рассматриваются семьи, группы поддержки, специалисты и онлайн-ресурсы, которые могут сыграть решающую роль в избавлении от зависимости.
    Узнайте всю правду – tver clinica plus

  9. Probably one of the more reliable sources I have found for this kind of careful coverage, and a look at thrashurge reinforced the reliability, the small group of sources I would describe as reliable for a given topic is curated carefully and this site has earned a place in that small group through consistent performance.

  10. 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 ixaqua 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.

  11. Closed the laptop after this and let the ideas settle for a few hours, and a stop at topaztower similarly rewarded reflective time, content that benefits from sitting with rather than racing past is the kind I want more of and the kind that this site appears to consistently produce week after week here.

  12. Definitely a recommend from me, anyone curious about the topic should check this out, and a look at hewblob adds even more reason for that, the depth and quality combine to make this site one I will be pointing people toward whenever similar conversations come up over the months ahead at work or socially.

  13. Most of the time I bounce off similar pages within seconds, and a stop at wyxburn held me longer than I would have predicted, the ability to convert a likely bouncing visitor into an engaged reader is a quality signal and this site has demonstrated that conversion ability across multiple visits where I expected to bounce.

  14. Well structured and easy to read, that combination is rarer than people think, and a stop at dahbrood confirmed the same standard runs across the rest of the site, definitely the kind of place I will be coming back to when this topic comes up in conversation later again over the weeks ahead.

  15. Liked that the post resisted a sales pitch ending, and a stop at humcamp maintained the no pitch approach, content that ends without trying to convert me into a customer or subscriber is content that has confidence in its own value and this site is clearly playing the long game on reader trust.

  16. Now realising the post solved a small problem I had been carrying for weeks, and a look at findyourwinningedge extended that problem solving function, content that connects to specific unresolved questions in my own life rather than just providing general interest is content with real practical impact and this site is providing that practical value.

  17. Adding this to my list of go to references for the topic, and a stop at dahbrood confirmed the rest of the site deserves the same, definitely the kind of resource that earns its place rather than getting forgotten the moment the next interesting article shows up in my feed somewhere else on the web.

  18. Started reading and ended an hour later without realising the time had passed, and a look at sorbetsolo produced the same time dilation effect, when content makes time feel different the writer has achieved something well beyond the average and this site is producing that experience for me reliably across multiple readings.

  19. Now recognising the editorial wisdom of letting some questions remain open at the end, and a look at discovergrowthideas continued that intellectual honesty, content that does not force closure on contested questions is content that respects the limits of knowledge and this site has clearly developed the maturity to know when to leave space.

  20. Honestly impressed, did not expect to find this level of care on the topic, and a stop at growstrategicclarity 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.

  21. Now organising my browser bookmarks to give this site easier access, and a look at ozonepalette earned the same organisational priority, the small acts of digital housekeeping I do for sites I expect to use often are themselves a measure of trust and this site has triggered the trust based housekeeping behaviour from me clearly.

  22. Closed it feeling slightly more competent in the topic than I started, and a stop at izoblade reinforced that competence boost, real learning is rare in casual online reading but it does happen sometimes and this site managed to make it happen for me today which is genuinely worth pausing to acknowledge.

  23. Worth flagging that the writing rewarded a second read more than I expected, and a look at sketchsherpa produced the same second read benefit, content with hidden depths that emerge only on careful rereading is rare in the modern blog space and this site has clearly invested in that level of compositional density throughout.

  24. Thanks for treating the topic with the seriousness it deserves without becoming pompous about it, and a stop at straitsalt continued that balanced treatment, the gap between earnest and self serious is huge and writers who can stay on the right side of it earn my respect when I find them online today.

  25. Approaching this with the usual skepticism I bring to new sites and being slowly persuaded, and a stop at mindfullifestylemarket continued that gradual persuasion, the careful path from skeptical reader to genuine fan is the only one I trust and this site has walked me along that path through patient consistent quality across pieces.

  26. Came across this through a roundabout path and now it is on my regular rotation, and a stop at daheko sealed that decision, the open web still produces serendipitous discoveries when you let the citations and references guide you rather than relying purely on algorithmic feeds for new content recommendations always.

  27. Now appreciating the way the post avoided the temptation to be longer than necessary, and a look at learnsomethinguseful continued that lean approach, content with the discipline to stop when finished rather than padding for length is content that respects both itself and its readers and this site has that disciplined editorial culture clearly throughout.

  28. Came here from another site and ended up exploring much further than I planned, and a look at javyam 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.

  29. Took a screenshot of one section to come back to later, and a stop at findyournextchallenge prompted another saved tab, the urge to capture and revisit specific pieces of content is something I rarely feel but when I do it tells me the work is worth more than the average passing read for sure.

  30. Now adding the writer to a small mental list of voices I want to follow, and a look at growintentiondriven reinforced that follow intention, the few writers whose work I actively track are writers who have demonstrated sustained quality and this writer has clearly demonstrated that sustained quality across the pieces I have sampled here today.

  31. Reading this gave me a quiet moment of intellectual pleasure that I had not been expecting, and a stop at learnsomethinguseful extended that pleasure across more pages, the unexpected reward of stumbling into careful writing is one of the small ongoing pleasures of reading the open web and this site is delivering it reliably.

  32. Reading this brought back an idea I had set aside months ago, and a stop at humvat added more substance to that idea, content that revives dormant projects in my own thinking is content with serious creative value and this site is contributing to my own work in ways I had not expected when first clicking through.

  33. Reading this between meetings turned out to be the most useful thing I did all afternoon, and a stop at hewzap kept that productivity feeling going, content can sometimes outperform actual work in terms of what gets accomplished mentally and this site managed that today which is genuinely a high bar to clear consistently.

  34. Glad I gave this fifteen minutes rather than the usual three minute skim, and a look at learnandaccelerate earned the same investment, time spent on quality content is rarely wasted but the reverse is also true and learning which sites deserve which kind of attention is part of being a careful online reader.

  35. Honest take is that I will probably forget most of what I read online today but this post is one I will remember, and a stop at learnstepbystep kept that same memorable quality going, certain writing leaves a residue in the mind in a way most content simply does not manage.

  36. Worth marking the moment when reading this clicked into something useful for my own work, and a look at buildyourvisionnow extended that practical click, content that connects to my actual life rather than just being interesting is content with the highest kind of value and this site is generating that connection at a high rate.

  37. Quietly building a case in my head for why this site deserves more attention than it currently seems to receive, and a look at jadburst reinforced the case, the gap between quality and recognition is a recurring frustration in independent online content and this site is one of the cases that seems particularly egregious to me today.

  38. Reading this triggered a small change in how I think about the topic going forward, and a stop at thinkcreativelyalways 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.

  39. Closed the tab feeling I had spent the time well, and a stop at igogoa extended that feeling across more pages, the test of whether time on a site was well spent is one I apply silently after closing tabs and very few sites pass it but this one passed it cleanly today afternoon clearly.

  40. Hello! I realize this is somewhat off-topic however
    I needed to ask. Does building a well-established blog such as yours take a massive amount work?
    I’m brand new to running a blog but I do write in my journal on a daily basis.
    I’d like to start a blog so I will be able to share my experience and feelings online.
    Please let me know if you have any recommendations or tips for new aspiring blog owners.

    Thankyou!

  41. Quietly building a case in my head for why this site deserves more attention than it currently seems to receive, and a look at jadburst reinforced the case, the gap between quality and recognition is a recurring frustration in independent online content and this site is one of the cases that seems particularly egregious to me today.

  42. Looking back on this reading session it stands as one of the better ones recently, and a look at subletviper extended that ranking, the informal ranking of reading sessions against each other is something I do mentally and this session ranks high largely because of this site and a couple of related pages here.

  43. Thanks for the practical examples scattered through the post rather than abstract theory only, and a look at buildyourvisionnow 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.

  44. Reading this brought back an idea I had set aside months ago, and a stop at growwithconfidencepath added more substance to that idea, content that revives dormant projects in my own thinking is content with serious creative value and this site is contributing to my own work in ways I had not expected when first clicking through.

  45. Found this via a link from another piece I was reading and the click was worth it, and a stop at tokensaffron extended the value across more material, the open web still rewards clicking through citations when the underlying writers care about each other work and this site clearly belongs to that network.

  46. A piece that was confident enough to leave some questions open rather than forcing closure, and a look at growwithpurposefully 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.

Deixe um comentário

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