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

  1. ketteglademarketstudio ketteglademarketstudio

    Over the course of reading several posts here a pattern of quality has emerged, and a stop at ketteglademarketstudio confirmed the pattern, the difference between sites that hit quality occasionally and sites that hit it consistently is huge and this site has clearly demonstrated the consistent kind through what I have read this morning.

  2. silverlaneemporium silverlaneemporium

    Came in confused about the topic and left with a much firmer grasp on it, and after silverlaneemporium I felt I could explain this to someone else without hesitation, that is the gold standard for any educational content and most sites simply fail to reach it ever which is unfortunate but true.

  3. globalcartcorner globalcartcorner

    A piece that reads like it was written for me without claiming to be written for me, and a look at globalcartcorner produced the same fit, when the writer audience match clicks naturally without being engineered through demographic targeting you know the writing is solid and this site has that natural fit consistently for me.

  4. velvetgrovecrafts velvetgrovecrafts

    A piece that did not lecture even when it had clear positions, and a look at velvetgrovecrafts maintained the same teaching without preaching tone, finding the line between informing and lecturing is hard and most sites land on the wrong side of it but this one has clearly figured out how to inform without becoming preachy.

  5. elitegoodscorner elitegoodscorner

    Worth pointing out that the writer made the topic feel more interesting than I had been expecting, and a look at elitegoodscorner 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.

  6. velvetgrovecrafts velvetgrovecrafts

    Adding to the bookmarks now before I forget, that is how good this is, and a look at velvetgrovecrafts confirmed the rest of the site is worth saving too, this is one of those rare finds that justifies the time spent searching the web for once which is a relief in the current environment.

  7. Liked the post enough to read it twice and the second read found new things, and a stop at leadimpact similarly rewarded the second look, content with hidden depths that only reveal themselves on careful rereading is the rare kind that earns lasting respect rather than fleeting first impressions only briefly held.

  8. urbanpetalcollective urbanpetalcollective

    The whole experience of reading this was pleasant from start to finish, no pop ups and no annoying interruptions, and a look at urbanpetalcollective continued that clean experience, technical choices about page design matter for the reader and this site clearly cares about the small details that add up to comfort across multiple visits.

  9. Now noticing that the post avoided the temptation to be funny in places where humour would have undermined the substance, and a stop at rankprism maintained the same restraint, knowing when to be serious is a rare editorial virtue and this site has clearly developed it through what I assume is careful editorial practice over years.

  10. techpackterra techpackterra

    Really appreciate this kind of writing, no shouting and no clickbait headlines just steady useful content, and a quick look at techpackterra kept that going, definitely a site I will be returning to whenever I need a sensible take on similar topics in the days ahead and also during slower work weeks.

  11. Came here from a search and stayed for the side links because they were that interesting, and a stop at leadimpact took me even further into the site, the kind of organic exploration that good content invites is something most sites kill through aggressive interlinking and pushy navigation choices rather than relying on quality.

  12. globalgoodszone globalgoodszone

    Found the rhythm of the prose particularly enjoyable on this read through, and a look at globalgoodszone kept that musical quality going across the related pages, sentence rhythm is something most blog writers ignore but it makes a real difference in how content lands with the careful reader who cares.

  13. “Spot on with the warning about wagering requirements. A lot of new Kiwi players see a ‘$1,000 Welcome Bonus’ and jump right in without checking the terms. A 35x or 40x playthrough requirement can completely drain that bonus before you can even think about withdrawing. Always read the fine print, folks.

  14. silveroakcorner silveroakcorner

    Easily one of the better explanations I have read on the topic, and a stop at silveroakcorner pushed it even higher in my mental ranking of useful resources, the kind of site that beats the average not by trying harder but by simply caring more about what it puts out daily which always shows.

  15. “This is exactly what I was looking for. I prefer to test the waters with a casual $10 or $20 deposit before committing a bigger bankroll to a new site. Finding casinos with low deposit minimums that still give you a few free spins is the sweet spot for casual players.

  16. silveroakcorner silveroakcorner

    Came away with a slightly better mental model of the topic than I started with, and a stop at silveroakcorner sharpened that further, content that improves the reader thinking apparatus rather than just dumping facts into it is the rare kind I genuinely value and seek out when I have time to read carefully.

  17. urbanpetalstore urbanpetalstore

    Pass this along to anyone you know dealing with similar questions, the answers here are clear, and a stop at urbanpetalstore adds even more useful material, this is the kind of resource that deserves to circulate widely rather than getting lost in the constant churn of new content online that buries good work daily.

  18. elitegoodsmarket elitegoodsmarket

    Most of my reading time goes to a small number of trusted sources and this one is now joining that group, and a stop at elitegoodsmarket reinforced the group membership, the few sites that earn a place in my regular rotation are sites I expect ongoing returns from and this one has earned that elevated position consistently.

  19. urbanpetalstore urbanpetalstore

    Got something practical out of this that I can apply later this week, and a stop at urbanpetalstore added more details to think about, this is exactly the kind of content I bookmark for future reference rather than the throwaway listicles that dominate most search results these days for almost any common topic.

  20. velvetoakcollective velvetoakcollective

    Coming back to this one, definitely, and a quick visit to velvetoakcollective only made me more sure of that, the kind of writing that makes you want to set aside time later rather than rushing through it now while distracted by everything else competing for attention on the screen today across so many tabs.

  21. 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 linkdrift kept that same memorable quality going, certain writing leaves a residue in the mind in a way most content simply does not manage.

  22. honeyvendorworkshop honeyvendorworkshop

    Came here from a search and stayed for the side links because they were that interesting, and a stop at honeyvendorworkshop took me even further into the site, the kind of organic exploration that good content invites is something most sites kill through aggressive interlinking and pushy navigation choices rather than relying on quality.

  23. nightsummittradehouse nightsummittradehouse

    A thoughtful read in a week that has been mostly noisy, and a look at nightsummittradehouse 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.

  24. amberpetalmarket amberpetalmarket

    Genuinely useful read, the points are practical and easy to apply right away, and a quick look at amberpetalmarket confirmed that this site is consistent in that approach, looking forward to digging through the rest of it when I get the chance to sit down properly later in the week or this weekend.

  25. goldentrendcenter goldentrendcenter

    Now considering whether the post would translate well into a different form, and a look at goldentrendcenter suggested similar versatility, content that could move into other media without losing its substance is content that has been built around ideas rather than around format and this site reads as idea first throughout posts.

  26. velvetorchidmarket velvetorchidmarket

    Worth recommending broadly to anyone who reads on the topic, and a look at velvetorchidmarket only confirms that, the rare combination of accessibility and depth in this site makes it suitable for both newcomers and people who already know the area which is hard to pull off in any blog format today and rarely managed.

  27. wavevendoremporium wavevendoremporium

    Started believing the writer knew the topic deeply by about the second paragraph, and a look at wavevendoremporium reinforced that confidence, the speed at which a writer establishes credibility through their writing is a useful quality signal and this writer establishes it quickly and quietly without resorting to credential dropping or self promotion.

  28. Most blog writing on this subject reaches for the same handful of arguments and this post avoided them, and a look at rankvibe 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.

  29. velvetorchidmarket velvetorchidmarket

    Worth recommending broadly to anyone who reads on the topic, and a look at velvetorchidmarket only confirms that, the rare combination of accessibility and depth in this site makes it suitable for both newcomers and people who already know the area which is hard to pull off in any blog format today and rarely managed.

  30. rapidgoodszone rapidgoodszone

    Easily one of the better explanations I have read on the topic, and a stop at rapidgoodszone pushed it even higher in my mental ranking of useful resources, the kind of site that beats the average not by trying harder but by simply caring more about what it puts out daily which always shows.

  31. elitegoodszone elitegoodszone

    Skipped the social share buttons but might come back to actually use one later, and a stop at elitegoodszone 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.

  32. futurecartarena futurecartarena

    Bookmarking this for later, the kind of resource I want to keep nearby, and a quick look at futurecartarena 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.

  33. silkbin silkbin

    Closed the laptop and walked away thinking about the post for a good twenty minutes, and a stop at silkbin produced similar lingering thoughts, content that survives the closing of the browser tab is content that has actually entered the mind rather than just decorating the screen for the duration of the reading.

  34. hypercartarena hypercartarena

    Appreciated that the writer trusted the reader to follow along without constant restating of earlier points, and a look at hypercartarena continued that respect for the reader, treating an audience as capable adults rather than as people to be hand held through every paragraph is something I notice and value highly across the open internet today.

  35. silkdash silkdash

    Worth recognising that the post handled a familiar topic without reaching for any of the obvious hot takes, and a stop at silkdash continued that fresh treatment, sites that find new angles on subjects others have exhausted are sites worth following carefully and this one has clearly developed that exploratory instinct through patient practice.

  36. Picked this site to mention to a colleague who would benefit, and a look at adnudge added more material I will pass along, recommending sites to colleagues is a higher bar than recommending to friends because the professional context demands more careful curation and this site cleared the professional bar without me having to think.

  37. grandport grandport

    Felt energised after reading rather than drained, which is unusual for online content these days, and a look at grandport continued that good feeling, content that leaves you better than it found you is rare and worth bookmarking when you stumble across it for the first time today or any other day really.

  38. tidydeal tidydeal

    Refreshing to read something where the words actually mean something instead of filling space, and a stop at tidydeal kept that going, the writing here trusts the reader to follow along without endless repetition or constant reminders of what was already said earlier in the post which I appreciate.

  39. silkgain silkgain

    Honestly this hits the sweet spot between detail and brevity, no rambling and no shortcuts, and a quick visit to silkgain kept that going across the related pages, the kind of place that respects your attention without trying to grab it through cheap tactics or attention seeking design choices that get tired fast.

  40. dusksave dusksave

    Once you start reading carefully here it is hard to go back to lower quality alternatives, and a stop at dusksave reinforced that ratchet effect, the way good content raises standards is real over time and this site has clearly contributed to raising my expectations for what is possible in writing on the topic generally.

  41. aurorastreetgoods aurorastreetgoods

    Picked this for a morning recommendation in our company chat, and a look at aurorastreetgoods suggested I will mention this site again later, recommending content into a workplace context is a small editorial act that requires confidence in the recommendation and this site is making me confident in those recommendations consistently here too.

  42. Looking back on this reading session it stands as one of the better ones recently, and a look at adrally 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. silkgain silkgain

    Now placing this in the same category as a few other sites I have come to trust, and a look at silkgain continued the placement decision, the small category of fully trusted sites is one I extend rarely and only after multiple positive reading sessions and this site has earned the category placement methodically over time.

Deixe um comentário

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