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

  1. Reading this slowly because the writing rewards a slower pace, and a stop at trivoxbond did the same, the pace at which I read content is something I now use as a quality signal and writing that earns a slower pace earns my attention as a reader looking for substance these days.

  2. More substantial than most of what I find searching for this topic online, and a stop at manilatakeout kept that quality consistent, this is one of those sites where the writing actually rewards careful reading rather than punishing the patient reader with empty filler stretched out across long paragraphs that say very little.

  3. Здорова, народ Муж просто потерял себя Родственники не знают что делать Нужен врач прямо сейчас Короче, единственный кто реально помог — вызов нарколога на дом анонимно Приехал через 40 минут В общем, не потеряйте контакты — платный нарколог на дом недорого https://zapoj.narkolog-na-dom-voronezh-11.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  4. Now planning to write about the topic myself eventually using this post as a reference, and a look at motocitee would also serve in that future piece, content that becomes raw material for my own writing rather than just informing my reading is content with multiplicative value and this site is generating that multiplicative effect.

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

  6. Reading this prompted me to subscribe to my first newsletter in months, and a stop at crownking88 confirmed the subscribe was the right call, content that earns a newsletter signup is content that has cleared a higher trust bar than a casual visit and this site has clearly earned that level of commitment from me.

  7. Worth every minute of the time spent reading, and a stop at nolarocore extends that value across more pages, in a media environment where most content is engineered to waste attention this site stands out by treating reader time as something valuable rather than something to be exploited and stretched as far as possible.

  8. Nice to see a post that does not try to overcomplicate the basics for the sake of looking smart, and once I looked at vixaropoint 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.

  9. Found this through a friend who recommended it and now I see why, and a look at mivaroline only strengthened that recommendation in my own mind, word of mouth still works for content that actually delivers and this site is clearly earning recommendations the old fashioned way through quality rather than marketing.

  10. One of the more honest takes on the topic I have seen lately, no spin and no oversell, and a stop at nixaroholdings kept that going, the kind of voice the open web could use a lot more of rather than the endless echo chamber of recycled opinions floating around every social platform these days.

  11. Genuine pleasure to read, and that is not something I say often after a casual click through, and a quick visit to vsmphotography kept the same feeling going across the rest of the site, finding writing that actually feels good to spend time with rather than just functional is increasingly rare on the open web.

  12. One of the more thoughtful posts I have read recently on this topic, and a stop at quorly added even more weight to that impression, this is genuinely good content that holds its own against far better known sites in the same space without trying to imitate any of them at all which I appreciate.

  13. Going to come back when I have more time to read carefully, the post deserves more than a quick scan, and a stop at trendingnewsfeed reinforced that, this is the kind of site that rewards a slower read which is hard to find in this fast paced corner of the internet but really worthwhile.

  14. Really like the way the post resists reaching for cliches that would have made it feel generic, and a quick visit to themetalsuckfest kept that fresh feel going, original phrasing and unexpected metaphors are signs that the writer is actually thinking rather than just stitching together familiar phrases into the appearance of content.

  15. Picked this for a morning recommendation in our company chat, and a look at vixarobonding 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.

  16. Felt the post had been written without looking over its shoulder, and a look at wellthwithcallie continued that confident posture, content written for its own sake rather than against imagined critics has a different quality and this site reads as written from a place of confidence rather than defensive justification of every claim.

  17. Now adding the writer to a small mental list of voices I want to follow, and a look at CelticKitchen 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.

  18. Generally I do not leave comments but this post merits a small note, and a stop at zylavobond extended that comment worthy quality, the urge to actively contribute to a sites community rather than passively consume from it is something specific content provokes and this site has provoked that engagement urge from me today.

  19. Started taking notes about halfway through because the points were stacking up, and a look at pelixotrustco 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.

  20. Skipped to a specific section because I knew that was the question I had, and the answer was clean, and a stop at savennkga similarly delivered targeted answers without burying them, content engineered for readers who arrive with specific needs rather than open ended browsing is increasingly valuable in a search heavy reading environment.

  21. Walked away with a clearer head than I had before reading this, and a quick visit to fullertonrecall only sharpened that, the writing has a way of cutting through the noise that surrounds most topics online which is something I will definitely remember the next time I am searching for an answer to anything.

  22. Better than most of the writing I have come across on this topic recently, simpler and more direct, and a look at pelixotrustco continued in that same way, a real outlier in a crowded space full of repetitive content that says little while taking up a lot of reader time today which is unfortunate.

  23. Thank you for not assuming the reader already knows everything, the explanations meet me where I am, and a look at zavirotrusthub did the same, that consideration is what makes a site feel welcoming rather than gatekeepy which is sadly the default mood across the modern web today for most subjects covered.

  24. Comfortable reading experience throughout, no jarring tone shifts and no awkward formatting, and a look at vexaropartners 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.

  25. Appreciated how the post felt complete without overstaying its welcome, and a stop at zaviroplex confirmed that economical approach runs across the site, knowing when to stop is a skill many writers never develop but here the discipline is obvious and welcome from the perspective of a busy reader trying to learn things efficiently.

  26. I usually skim posts like these but this one held my attention all the way through, and a stop at discoverprofessionalgrowth did the same, that is a strong endorsement coming from me because I am usually quick to bounce when content gets repetitive or fails to deliver on its initial promise made in the headline.

  27. Came in for one specific question and got answers to three I had not even thought to ask, and a look at zavirotrusthub extended that bonus value pattern, the kind of resource that anticipates reader needs rather than just answering the literal question asked is the gold standard and this site reaches it.

  28. The conclusions felt earned rather than tacked on at the end like an afterthought, and a look at velon kept that careful structure going, you can tell when a writer has thought about the shape of their post versus just letting it ramble out and hoping for the best at the end which most do.

  29. Glad I gave this a chance rather than scrolling past, and a stop at zaviroplex confirmed I made the right call, sometimes the best content is hidden behind unassuming headlines that do not scream for attention and learning to slow down and check those out has paid off many times now across years of reading.

  30. Just enjoyed the experience without needing to think about why, and a look at discoverprofessionalgrowth kept that effortless feeling going, sometimes the best content is invisible in the sense that you forget you are reading until you reach the end and realise time has passed without you noticing it pass naturally.

Deixe um comentário

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