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.

10.025 Comentários

  1. A clear case of writing that does not try to do too much in one post, and a look at discoverprofessionalgrowth maintained the same scoped discipline, posts that try to cover too much end up covering nothing well and this site has clearly chosen scope discipline as a core editorial principle which shows up clearly in what I read.

  2. Speaking as someone who used to recommend blogs frequently and got out of the habit this site is rekindling that impulse, and a look at modernretailbuyinghub extended the rekindling, the recovery of an old habit triggered by encountering work that justifies it is itself a small kind of pleasure and this site is providing that recovery experience.

  3. Really grateful for content like this, it does not waste my time and it does not insult my intelligence either, and a quick look at flexibleshoppingoutlet was the same, balanced respectful writing that makes a person feel welcome rather than rushed through pages of forced engagement just to keep clicking around.

  4. A piece that handled the topic with appropriate weight without becoming portentous, and a look at modernretailbuyinghub continued that calibrated seriousness, content that takes itself seriously without becoming pompous is something this site has clearly figured out and the balance shows up in every piece I have read across multiple sessions now.

  5. Started reading skeptically because the headline seemed overconfident, and the post earned the headline by the end, and a look at trustedshoppingzone continued that pattern of earning its claims, sites that can back up their headlines without overpromising are rare and this one has clearly developed editorial calibration on that front consistently.

  6. Reading this in the morning set a good tone for the day, and a quick visit to nextgenshoppinghub kept that good tone going, content can do that sometimes when it hits the right notes and finding sites that consistently strike that tone is something I have learned to recognise and reward with regular visits.

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

  8. Picked up several practical tips that I plan to try out this week, and a look at globaltrustpartnerships added a few more I will be testing alongside, content with practical hooks that connect to my actual life is the kind that earns my repeat attention rather than the merely interesting that I forget within a day.

  9. Yesterday I was complaining about the state of online writing and today this site has temporarily fixed that complaint, and a look at corporatepartnershipnetwork extended that mood reversal, the short term mood improvement that comes from finding good content is real and this site has produced that improvement for me at a useful moment.

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

  11. Bookmarked the page and the homepage too because clearly there is more to explore here, and a quick stop at fogharborgoods 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.

  12. Howardjet Howardjet

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

  13. Halfway through reading I knew this would be one to bookmark, and a look at gamesofufabets confirmed that early intuition, when bookmark intent forms before finishing a post you know the writing has cleared a quality bar that most content fails to clear and this site has cleared it on multiple visits already.

  14. Useful information presented in a way that does not feel like a sales pitch, that is what I appreciated most, and a stop at securestrategicbonds was the same, no upsell and no fake urgency just steady content laid out properly for someone trying to actually learn from it rather than just be sold to.

  15. A piece that brought a sense of order to a topic I had been finding chaotic, and a look at globalshoppinginfrastructure continued that organising effect, content that imposes useful structure on messy subjects is doing genuine intellectual work and this site is providing that organisational function across multiple posts I have read recently here.

  16. Reading this gave me a small refresher on something I had partially forgotten, and a stop at securestrategicbonds extended the refresher, content that strengthens existing knowledge rather than just adding new is content with a particular kind of consolidating value and this site is providing that consolidating function across multiple visits.

  17. Approaching this with the usual skepticism I bring to new sites and being slowly persuaded, and a stop at trustedcommercialnetwork 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.

  18. Really appreciate that the writer did not overstate the importance of the topic to make the post feel weightier, and a quick visit to clicktofindbusinessclarity maintained the same modest framing, content that is honest about its own scope rather than inflating itself is the kind I trust and return to repeatedly over time.

  19. Polished and informative without feeling overproduced, that is the sweet spot, and a look at flexibleshoppingmart 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.

  20. Came here from a search and stayed for the side links because they were that interesting, and a stop at clicktoadvanceforward 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.

  21. A piece that brought a sense of order to a topic I had been finding chaotic, and a look at findbetterstrategies continued that organising effect, content that imposes useful structure on messy subjects is doing genuine intellectual work and this site is providing that organisational function across multiple posts I have read recently here.

  22. Even on a quick first read the substance of the post comes through, and a look at clicktoexpandknowledgebase reinforced that immediate quality, content that does not require a slow careful read to demonstrate value but rewards one anyway is content with real depth and this site has produced work of that demanding depth class.

  23. The headings made navigating the post simple even when I needed to find a specific section quickly, and a look at tectotechnologynewzz continued the same thoughtful structure, small details like clear headings show that someone is actually thinking about how the reader uses the page rather than just filling it for length alone.

  24. Reading this gave me material for a conversation I needed to have anyway, and a stop at gameswithufabet added even more talking points, content that connects to upcoming social or professional needs rather than just being interesting in the abstract is the kind that earns priority placement in my attention these days routinely.

  25. Skipped the comments to avoid spoilers and came back later to find them genuinely worth reading, and a stop at buildforwardsteps extended that surprised respect, when the discussion below a post matches the quality of the post itself you have found something special and this site appears to attract that kind of audience.

  26. Probably the kind of site that should be more widely read than it appears to be, and a look at globalbusinessalliances 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.

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

  28. Worth observing that the post landed without needing a flashy headline to hook attention, and a stop at reliablebuyinghub did the same, content that earns engagement through substance rather than packaging is the kind I trust more deeply and this site has clearly chosen substance as the primary lever for reader engagement throughout.

  29. Excellent post, balanced and well organised without showing off, and a stop at clicktoexpandknowledge 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.

  30. Quietly the writers approach to the topic differs from the dominant takes I have been encountering, and a stop at digitalretailsolutions extended that distinctive approach, content that maintains a different perspective without explicitly arguing against the dominant ones is content with confident editorial identity and this site has that confidence throughout pieces.

Deixe um comentário

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