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

  1. Honestly enjoyed every minute spent here, that is not something I say lightly, and a look at simplelivingmarket confirmed I will be back, the bar for spending time online is high for me these days but this site clears it without effort which is high praise indeed from this reader who is usually rather demanding.

  2. Skipped the social share buttons but might come back to actually use one later, and a stop at globaltrendoutlet extended that share urge, content that triggers genuine sharing impulses rather than performative ones is content that has actually moved me and not many posts in a typical week do that for me actually.

  3. wildwoodfashion wildwoodfashion

    My professional context would benefit from having this kind of resource available, and a look at wildwoodfashion extended the professional applicability, the rare site that contributes meaningfully to professional work rather than just personal interest is content with multiplied value and this one is providing that professional utility consistently across multiple pieces.

  4. Worth pointing out that the post avoided the temptation to summarise everything at the end, and a look at honestharvesthub 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.

  5. findpurposeandpeace findpurposeandpeace

    Liked that there was nothing performative about the writing, and a stop at findpurposeandpeace continued that genuine quality, performative writing tries to be witnessed rather than read and the difference between performance and substance is huge for the careful reader and this site has clearly chosen substance every time clearly.

  6. A piece that exhibited the kind of patience that good writing requires, and a look at happylivingoutlet continued that patient quality, hurried writing is easy to spot and this site reads as having been written without time pressure which produces a different feel than the rushed content that dominates much of the modern blog space.

  7. Felt the writer respected the topic without being precious about it, and a look at globaltrendoutlet continued that respectful but unfussy treatment, finding the right register for serious topics is hard and this site has clearly figured out how to take the topic seriously while still being readable for casual visitors regularly.

  8. fashionpicksmarket fashionpicksmarket

    Great work on keeping things readable, the post never drags or repeats itself which I really appreciate, and a stop at fashionpicksmarket added a bit more context that fit naturally with what was already said here, no need to read everything twice to get the point being made today.

  9. Took something from this I did not expect to find, and a stop at honestharvesthub added another unexpected useful piece, content that exceeds expectations rather than just meeting them is the kind that builds enthusiasm and earns repeat visits without any explicit ask from the writer or platform behind the work being read.

  10. A piece that took its time without dragging, and a look at shopandsmiletoday 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.

  11. Thanks for the breakdown, it gave me a clearer picture of something I had been confused about for a while now, and a stop at newvoyagecorner closed the remaining gaps in my understanding nicely, no need to hunt around twenty other articles to put the pieces together which is a real time saver.

  12. Without comparing too aggressively to other sources this one stands out for the right reasons, and a look at fashionfindsmarket continued that distinctive quality, content that distinguishes itself through substance rather than style tricks is content with lasting differentiation and this site has clearly chosen substance based differentiation as its core editorial strategy.

  13. fashionpicksmarket fashionpicksmarket

    Great work on keeping things readable, the post never drags or repeats itself which I really appreciate, and a stop at fashionpicksmarket added a bit more context that fit naturally with what was already said here, no need to read everything twice to get the point being made today.

  14. Worth saying that the prose reads naturally without straining for style, and a stop at dreamfashionoutlet maintained the same unforced quality, writing that achieves elegance without effort is the highest tier and this site has clearly worked out how to land that effortless quality consistently rather than only on the writers best days.

  15. A thoughtful read in a week that has been mostly noisy, and a look at newvoyagecorner carried that thoughtful quality across more pages, finding pockets of considered writing in a week of distractions is one of the small wins of careful curation and this site is providing those pockets at a sustainable rate.

  16. Liked the careful word choice throughout, every term seemed picked for a reason rather than thrown in casually, and a stop at softcloudboutique continued that precise style, this kind of attention to small details is what separates careful writing from the usual rushed content that dominates blog spaces today across pretty much every topic I follow.

  17. Now leaving a small mental note to recommend this when the topic comes up in conversation, and a look at timberwoodcorner extended that recommend ready feeling, content that arms me with shareable references for likely future conversations is content with social value and this site is providing that conversational ammunition consistently for me lately.

  18. I have been curious about these trends, and you have really helped me. I have just told a few of my friends about this on FaceBook and they love your content just as much as I do.

  19. yourdealhub yourdealhub

    If the topic interests you at all this is a place to spend time, and a look at yourdealhub reinforced that recommendation, the broader question of where to invest topical reading time is one this site answers convincingly through the consistent quality across multiple pieces I have sampled during the current reading session today.

  20. I really like the calm tone here, it does not push anything on the reader, and after I went through timberwoodcorner I felt the same way, just steady useful content laid out without drama, which is exactly what someone trying to learn something quickly needs to find rather than aggressive marketing.

  21. Came away with a small but real shift in perspective on the topic, and a stop at highpineoutlet pushed that shift a bit further, the kind of subtle reframing that good writing does to a reader without making a big deal of it is something I always appreciate when it happens which is sadly not that often.

  22. Genuinely changed how I think about a small piece of the topic, which does not happen often online, and a look at globalstylecorner added another nudge in the same direction, the kind of writing that earns a small mental shift rather than just confirming what you already thought before reading is a sign of careful thought.

  23. inspireeverymoment inspireeverymoment

    Bookmarking this for later, the kind of resource I want to keep nearby, and a quick look at inspireeverymoment confirmed the rest of the site is worth the same treatment, definitely going into my reference folder for the next time the topic comes up at work or in conversation with someone who asks.

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

  25. A clear cut above the usual noise on the subject, and a look at highpineoutlet only made that gap wider in my view, the kind of place that earns its visitors through quality rather than through aggressive marketing or sponsored placements which is increasingly the only way most sites stay afloat across the modern web.

  26. Reading this fit naturally into my afternoon walk because I was reading on my phone, and a stop at fashiondealstore continued well in that walking format, content that survives mobile reading without becoming awkward is content with format flexibility and this site has clearly thought about how it reads across different devices today.

  27. Started taking notes about halfway through because the points were stacking up, and a look at happylivinghub added enough material that my notes file grew further, content that demands note taking from a passive reader is content with substance and the writers here are clearly producing that kind of work consistently across topics.

  28. inspireeverymoment inspireeverymoment

    Liked the careful selection of which details to include and which to skip, and a stop at inspireeverymoment reflected the same editorial judgement, knowing what to leave out is just as important as knowing what to include and this site has clearly figured out where that line sits for the topics it covers regularly.

  29. dreamdiscovercreate dreamdiscovercreate

    Useful reading material, the kind I can hand off to someone newer to the topic without worrying about confusing them, and a quick look at dreamdiscovercreate confirmed the same beginner friendly tone runs throughout the site which is great for sharing with people just starting their learning journey on this particular topic.

  30. Greetings I am so grateful I found your blog page, I
    really found you by error, while I was looking on Aol for something else, Anyways I am here
    now and would just like to say many thanks for a fantastic post and a all round entertaining blog (I
    also love the theme/design), I don’t have time to read through it all
    at the minute but I have book-marked it and also included your RSS feeds, so when I
    have time I will be back to read much more, Please do keep up the superb jo.

  31. fashionloversoutlet fashionloversoutlet

    Speaking as someone who reads a lot on this topic this site has earned a high position in my source rankings, and a stop at fashionloversoutlet reinforced that ranking, the informal ranking of sources for a topic is something I maintain mentally and this site has moved into the upper portion of those rankings clearly.

  32. Came back to this an hour later to reread a specific section, and a quick visit to fashiondealstore also drew a second look, content that pulls you back rather than letting you move on permanently is the kind I want to fill my browser bookmarks with in 2026 and beyond as the open internet evolves.

  33. Liked how the writer used real examples instead of theoretical ones to make the points stick, and a stop at trendycollectionstore added even more concrete examples, this is the kind of practical approach that respects readers who actually want to apply what they learn rather than just nodding along passively without doing anything useful.

  34. believeinyourdreams believeinyourdreams

    Came across this looking for something else entirely and ended up reading it through twice, and a look at believeinyourdreams pulled me deeper into the site than I planned, the writing has a way of holding attention without resorting to manipulative cliffhangers or vague promises that never get delivered later down the page.

  35. Now organising my browser bookmarks to give this site easier access, and a look at simpledealmarket 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.

  36. Quietly the post solved something I had been turning over without quite knowing how to phrase the question, and a look at softblossomcorner extended that quiet solving, content that addresses unformulated needs is content with reader insight and this site has demonstrated that insight at a high rate across the pieces I have read recently.

  37. oldtownstylehub oldtownstylehub

    Comfortable reading experience throughout, no jarring tone shifts and no awkward formatting, and a look at oldtownstylehub kept that smooth feel going, the kind of editorial polish that goes unnoticed when present but glaring when absent is something this site has clearly invested in across the broader content as well which deserves recognition.

  38. Halfway through I knew I would finish the post, and a stop at puregiftmarket also held me through to the end, content that signals its quality early and then sustains it is content with real internal consistency and this site has clearly figured out how to maintain quality from opening sentence through to closing thought.

  39. oldtownstylehub oldtownstylehub

    Now feeling something close to gratitude for the fact this site exists, and a look at oldtownstylehub extended that gratitude, the rare site that produces this kind of response is the rare site worth defending in conversations about whether the modern internet is still capable of producing genuinely valuable independent content for serious adults.

  40. grandforeststudio grandforeststudio

    A welcome reminder that thoughtful writing still happens online, and a look at grandforeststudio extended that reassurance, the modern web makes it easy to forget that careful writing exists and finding sites that practice it is a small antidote to the cynicism that builds up from too much exposure to algorithmic content.

  41. Polished and informative without feeling overproduced, that is the sweet spot, and a look at puregiftmarket hit it again, you can tell when a site has been built with care versus thrown together for the sake of having something to put online and this is clearly the former approach taken by the team.

  42. Genuine reaction is that this site clicked with how I like to read, and a look at globalchoicehub kept that comfortable fit going, sometimes you find a place online whose editorial decisions just align with your preferences and when that happens it is worth recognising and supporting through repeat engagement consistently going forward.

  43. Reading this gave me confidence to make a decision I had been putting off, and a stop at happylifestylemarket reinforced that confidence, content that translates into action in my own life rather than just informing it is content with the highest practical value and this site is generating that action level utility for me lately.

  44. uniquevaluehub uniquevaluehub

    The pacing of the post was just right, never rushed and never dragged out unnecessarily, and a look at uniquevaluehub 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.

  45. purefashionworld purefashionworld

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

Deixe um comentário

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