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.

7.197 Comentários

  1. dreamshopworld dreamshopworld

    Skipped lunch to finish reading, which says something, and a stop at dreamshopworld kept me at my desk longer than planned, when content beats the lunch impulse the writer has done something genuinely impressive in an attention environment full of immediately satisfying alternatives competing for the same finite block of reader time.

  2. yourgiftcorner yourgiftcorner

    Liked the way the post handled the final paragraph, no neat bow but no abrupt cutoff either, and a stop at yourgiftcorner continued that thoughtful ending pattern, endings are hard and most blog writers either over engineer them or skip them entirely and this site has clearly figured out a sustainable middle approach.

  3. startbuildingtoday startbuildingtoday

    Nice to see a post that does not try to overcomplicate the basics for the sake of looking smart, and once I looked at startbuildingtoday the same direct tone was there too, which honestly makes a difference when you are short on time and want answers without long pointless intros.

  4. modernvaluecollection modernvaluecollection

    If I were to recommend a starting point for the topic this site would be near the top of my list, and a stop at modernvaluecollection reinforced that recommendation status, the small list of starting point recommendations I keep for friends asking about topics is short and this site is now firmly on it.

  5. Russelljax Russelljax

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

  6. modernlivinghub modernlivinghub

    Solid post, the structure is easy to follow and the language stays simple even when the topic gets a bit more involved, and a look at modernlivinghub kept that same standard going, so I left feeling like the time spent here was actually worth something for once which is rare lately.

  7. A small editorial detail caught my attention, the way headings related to body text, and a look at learnsomethingvaluable maintained that careful relationship, structural details like that show up to readers who notice them and the writers here have clearly thought about every level of the piece rather than just the words.

  8. Closed and reopened the tab three times before finally finishing, and a stop at urbanwearhub held my attention straight through, sometimes content fights for time against my own distraction and the times it wins say something positive about its quality and this post clearly won that fight today afternoon for me.

  9. Worth pointing out that the post avoided the temptation to summarise everything at the end, and a look at staymotivateddaily continued that confident closing approach, content that trusts readers to retain the substance without being reminded of it at the end is content that respects the reader and this site practices that respect.

  10. I appreciate the clarity here, everything is explained in simple terms without unnecessary detail, and after a quick stop at timberlinewebstore 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.

  11. Probably the kind of site that should be more widely read than it appears to be, and a look at uniquegiftmarket reinforced that quiet wish, the gap between a sites quality and its apparent reach is sometimes large and that gap exists for this site in a way that makes me want to mention it more.

  12. Picked this up while looking for something else and ended up reading every paragraph because it was actually informative, and after timberlinewebstore I was sure I would come back, that does not happen often when most sites bury the useful parts under endless ads and pop ups today and across most categories online.

  13. Really appreciate the lack of pop ups, modals, cookie banners stacking on top of each other, and a quick visit to happydailycorner confirmed the same clean approach across the rest of the site, technical decisions about user experience are part of what makes content actually pleasant to engage with for sure.

  14. Now wishing more sites covered topics with this level of care, and a look at happyshoppingcorner extended that wish across more subjects, the rarity of careful coverage on most topics is a problem and this site is one of the small antidotes to that broader pattern of casual or surface treatment of complex subjects.

  15. Most posts I read end up forgotten within a day but this one is sticking, and a look at startdreamingbig extended that lingering effect, content that survives the immediate moment of reading rather than evaporating is content with genuine retention quality and this site has been producing memorable pieces at a rate notable across my reading.

  16. creativechoicecorner creativechoicecorner

    Closed the post with a small satisfied sigh, and a stop at creativechoicecorner produced the same gentle exhale, content that ends well is content that respects the rhythm of reading and the writers here have clearly thought about how their pieces close rather than just trailing off when they run out of things to say.

  17. Ended up here on a wandering afternoon and was glad I stayed for the read, and a stop at uniquegiftcenter 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.

  18. Thanks for taking the time to write this, it is clear that some thought went into how each point would land, and after I went through findyouranswers I had a better grip on the topic, real value without the usual marketing noise people have to put up with online when searching for answers.

  19. majesticgrovers majesticgrovers

    Bookmark added in three places to make sure I do not lose the link, and a look at majesticgrovers got the same redundant treatment, sites I am afraid to lose are the rare keepers and this is clearly one of them based on what I have read so far across this and a couple of related posts.

  20. Bookmark earned and folder updated to track this site separately, and a look at happychoicecorner confirmed the folder upgrade was the right call, organising my reading list so that good sites do not get lost in a sea of casual bookmarks is something I do more carefully now and this site warranted its own spot.

  21. 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 purefashionchoice confirmed I should have just read it first, every section of this site appears to deserve careful attention rather than skipping past lazily.

  22. Just sat with this for a bit longer than I usually would because the points are worth thinking about, and after timelessstyleplace I had even more to chew on, the kind of post that nudges your thinking forward without forcing the issue is something I have always appreciated in good writing online.

  23. Bookmark earned and folder updated to track this site separately, and a look at timelessstyleplace confirmed the folder upgrade was the right call, organising my reading list so that good sites do not get lost in a sea of casual bookmarks is something I do more carefully now and this site warranted its own spot.

  24. createpositivechange createpositivechange

    However many similar pages I have read this one taught me something new, and a stop at createpositivechange added more new material, content that contributes genuinely fresh information rather than recycling what is already widely available is content with real informational value and this site is providing that informational freshness at a notable rate.

  25. finduniqueoffers finduniqueoffers

    Skimmed first and then went back to read carefully, and the careful read paid off in places I had missed, and a stop at finduniqueoffers got the same treatment, the rare site whose content rewards a second pass is content I want more of in my regular rotation rather than disposable single read articles.

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

  27. finduniqueoffers finduniqueoffers

    Honestly this kind of writing is why I still bother to read independent sites, and a look at finduniqueoffers extended that broader reflection, the few sites that justify continued attention to non algorithmic content are sites like this one and finding them periodically is enough to keep my reading habits oriented toward independent rather than aggregated content.

  28. Reading this gave me a small mental break from the heavier reading I had been doing, and a stop at findsomethingbetter extended that lighter feel, content that provides relief without becoming trivial is harder to produce than people realise and this site has clearly figured out how to be light without being shallow at all.

  29. brightleafemporium brightleafemporium

    Took the time to read the comments on this post too and they were also worth reading, and a stop at brightleafemporium suggested the community quality matches the content quality, when the conversation around a piece is as good as the piece itself you know you have found a real corner of the internet.

  30. Worth saying that the writing carries a particular kind of authority without making any explicit claims to it, and a stop at simpletrendmarket extended that earned authority feeling, sites that demonstrate expertise through the quality of their explanations rather than by stating credentials are sites I trust most and this site has it.

  31. Well crafted post, the structure flows naturally from one point to the next without forcing transitions, and a stop at findsomethingbetter 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.

  32. Liked the way the post balanced confidence and humility, and a stop at coastalbrookstore maintained the same balance, knowing when to assert and when to acknowledge uncertainty is a sign of mature thinking and the writers here have clearly developed that calibration through what I assume is years of careful work on their craft.

  33. yourjourneycontinues yourjourneycontinues

    Appreciate the practical examples, they made the abstract points easier to grasp, and a stop at yourjourneycontinues 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.

  34. yourdailycollection yourdailycollection

    Came away with some new perspectives I had not considered before, and after yourdailycollection those ideas felt more complete, the kind of content that stays with you a little while after reading rather than slipping out the moment you switch tabs and move on with your day to whatever comes next.

  35. happyhomehub happyhomehub

    Picked something concrete from the post that I will use immediately, and a look at happyhomehub added another concrete piece, content that produces immediately useful output rather than just abstract appreciation is content that earns its place in my regular rotation without needing any further evaluation from me at this point honestly.

  36. Reading this in the gap between work projects was a small but meaningful break, and a stop at simplevaluecorner extended that gentle reset, content that provides genuine refreshment rather than just distraction during work breaks is content with a particular kind of utility and this site fits that role for me reliably during work days.

  37. JamesPooto JamesPooto

    В этой статье мы рассматриваем разрушительное влияние зависимости на жизнь человека. Обсуждаются аспекты, такие как здоровье, отношения и профессиональные достижения. Читатели узнают о необходимости обращения за помощью и о путях к восстановлению.
    Читать полностью – Наркологическая клиника «Похмельная служба» в Краснодаре

  38. simplevaluehub simplevaluehub

    A piece that ended with a clean landing rather than fading out, and a look at simplevaluehub maintained the same crisp conclusions, endings that resolve rather than dissolve are a sign of careful structural thinking and this site has clearly invested in how its pieces conclude rather than letting them simply run out of energy.

  39. If I were to recommend a starting point for the topic this site would be near the top of my list, and a stop at trendandfashionzone reinforced that recommendation status, the small list of starting point recommendations I keep for friends asking about topics is short and this site is now firmly on it.

  40. Now adding this site to a small mental group of recommendations I keep ready for specific kinds of inquiries, and a stop at trendylivingcorner extended the recommendation readiness, content that I can confidently point friends and colleagues toward in specific contexts is content with real social utility and this site has that utility clearly.

  41. Liked the natural conversational tone throughout, never stiff and never overly casual either, and a stop at inspiregrowthdaily kept that comfortable middle ground going, finding a tone that respects the reader without becoming distant or overly familiar is harder than it sounds and this site nails that balance consistently across many different pieces.

  42. Bookmark earned and folder updated to track this site separately, and a look at shopforvalue confirmed the folder upgrade was the right call, organising my reading list so that good sites do not get lost in a sea of casual bookmarks is something I do more carefully now and this site warranted its own spot.

  43. This actually answered the question I had been searching for, and after I checked starlitstylehouse I had a few more pieces I had not realised I needed, that is the sign of a site that knows what its readers want before they even know how to ask it which is impressive.

  44. brightcollectionstore brightcollectionstore

    Left me wanting to read more rather than feeling burned out, that is a good sign, and a look at brightcollectionstore confirmed there is plenty more here to explore, the kind of writing that builds appetite rather than killing it which is a rare quality on the modern open internet today across most categories of content.

  45. Started reading expecting to disagree and ended mostly nodding along, and a look at purechoicecenter continued the pattern, content that wins agreement through evidence and reasoning rather than rhetorical force is the kind that actually shifts minds and this site clearly knows how to do that across what I have read so far.

  46. findpeaceandpurpose findpeaceandpurpose

    Reading this prompted a brief but useful conversation with a colleague who happened to walk by, and a stop at findpeaceandpurpose extended that conversational seed, content that becomes a starting point for in person discussion rather than ending in solitary reading is content with social generative energy and this site has plenty of it apparently.

  47. A piece that did not waste any of its substance on sales or promotion, and a look at trendylifestylecorner continued that pure content focus, sites that resist the urge to monetise every paragraph are increasingly rare and this one has clearly made the editorial choice to keep the writing clean from commercial intrusion which I value highly.

Deixe um comentário

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