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.

5.884 Comentários

  1. Worth recognising that this site does not chase the daily news cycle, and a stop at alpinecovevendorworkshop confirmed the longer publication arc, sites that resist the pressure to comment on every passing event are sites with genuine editorial discipline and this one has clearly chosen depth over volume which I respect deeply.

  2. Honest assessment after reading this twice is that it holds up under careful attention, and a look at mintmeadowgoodsroom extended that durability across more pages, content that survives a second read without revealing weak spots is rarer than the average reader probably realises and this site clearly cleared that bar.

  3. Following a few of the internal links revealed more posts of similar quality, and a stop at goldencovemarkethall added more to that growing pile, sites where internal links lead to more good content rather than to more of the same recycled material are sites with depth and this one has clearly built that depth carefully.

  4. My time on this site has now extended past what I had budgeted, and a stop at coralharbormerchantgallery keeps extending it further, content that overstays its budget in my schedule is content that has earned the extra time and this site has been earning extra time across multiple visits to the point where my schedule needs adjustment.

  5. Now feeling mildly impressed in a way I do not quite remember feeling about a blog in a while, and a stop at fastgoodsbazaar extended that mild impression, content that produces specific positive emotional responses rather than just neutral information transfer is content with extra dimensions and this site has those extra dimensions clearly.

  6. Glad the writer did not feel compelled to cover every possible angle of the topic, focus is a virtue, and a stop at trailharbortradeparlor reflected the same disciplined scope, knowing what to leave out is half of what makes good writing good and this post has clearly been edited with that principle in mind.

  7. Solid quality, the kind of work that holds up to a careful read rather than a quick skim, and a quick look at foxarbor kept that standard going strong, content that rewards attention rather than punishing it is something I appreciate more and more these days online across nearly every topic I follow.

  8. I learned more from this short post than from longer articles I read earlier today, and a stop at silverharborcommercegallery added even more useful detail without going off topic, this site clearly knows how to keep things focused without sacrificing depth which is a hard balance to strike for any writer.

  9. A small thing but the line spacing and font choices made reading this physically pleasant, and a look at explorefreshgrowth maintained the same careful design, technical choices about typography are part of what makes online reading actually comfortable and this site has clearly invested in the design layer alongside the content layer carefully.

  10. Reading this gave me a small refresher on something I had partially forgotten, and a stop at globalcartcenter 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.

  11. Now wishing I had found this site sooner, and a look at mintmeadowgoodsroom extended that mild regret, the calculation of how many years of good content I missed by not finding the right sources earlier is one I try not to make too often but it does come up sometimes when I find sites this good.

  12. Useful enough to recommend to several people I know who would appreciate it, and a stop at skyharborartisanexchange added more material I will pass along too, the kind of writing that earns word of mouth is the kind that actually delivers on its promises which is what this site does without any drama or fanfare attached.

  13. Telefonumdan rahatça ulaşabileceğim bir uygulama lazımdı. Sürekli farklı linkler geliyordu kime inanacağımı şaşırdım. Adımları doğru sırayla uyguladıktan sonra erişim sorunsuz açıldı. En sonunda doğru kaynağa ulaştım ve size de tüm detayları aktarmak istedim, güncel bilgilere buradan bakabilirsiniz: 1xbet android apk 1xbet android apk. Valla bak net söyleyeyim — android uygulaması gerçekten stabil çalışıyor.

    depolama alanı da fazla yemiyor gerçekten. İşin doğrusunu söylemek gerekirse — başka yerde vakit kaybetmeyin yani. Şimdiden iyi şanslar ve bol kazançlar…

  14. Definitely a recommend from me, anyone curious about the topic should check this out, and a look at fastgoodsbazaar adds even more reason for that, the depth and quality combine to make this site one I will be pointing people toward whenever similar conversations come up over the months ahead at work or socially.

  15. Now considering the post as evidence that careful blog writing is still possible, and a look at solarmeadowmarketroom extended that evidence, the broader question of whether the modern web can sustain quality writing has obvious empirical answers in sites like this one and seeing them is reassuring even when they remain a minority overall today.

  16. A welcome reminder that thoughtful writing still happens online, and a look at silverharborcommercegallery 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.

  17. A piece that demonstrated competence without performing it, and a look at dawnridgecraftcollective maintained the same self assured but unshowy register, the gap between competence and performance of competence is one I track and this site has clearly chosen to demonstrate rather than perform which I find much more persuasive as a reader.

  18. Easily one of the better explanations I have read on the topic, and a stop at auroracoveartisanexchange 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.

  19. Reading this slowly in the morning before opening email, and a stop at harborstonecraftcollective extended that protected attention, content that earns the prime morning reading slot before the daily distractions begin is content with elevated status and this site has earned that prime slot consistently in my recent reading habits clearly.

  20. A piece that was confident enough to leave some questions open rather than forcing closure, and a look at coralharbormerchantgallery continued that intellectual honesty, content that admits the limits of its scope is more trustworthy than content that pretends to total understanding and this site has the right calibration on certainty consistently.

  21. Just want to record that this site is entering my regular reading list, and a look at skyharborartisanexchange confirmed it deserves the spot, my regular reading list is short and well curated and adding to it requires meeting a fairly high quality bar that this site has clearly cleared without much effort apparently.

  22. Felt like the writer was speaking directly to someone with my level of curiosity, neither talking down nor showing off, and a stop at windharborartisanexchange kept that comfortable matching going, finding writing that meets you where you are rather than asking you to climb up or stoop down feels great every time it happens.

  23. Honestly informative, the writer covers the ground without showing off, and a look at honeymeadowmarketroom reflected the same humility, content that respects the reader rather than trying to dazzle them is something I always appreciate and rarely come across in this corner of the internet today across the topics I usually read.

  24. Did not expect much when I clicked through but ended up reading the whole thing carefully, and a stop at orchardharborvendorhall kept that engagement going, sometimes the unassuming sites turn out to deliver more than the flashy ones which is something I have learned to look out for over time online lately and across topics.

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

  26. Granted my mood today might be elevating my reading experience but I still think this is genuinely good, and a stop at globalcartcenter reinforced that even discounted assessment, controlling for the mood adjustment that affects content perception this site still reads as substantively above average across multiple pieces I have read carefully today.

  27. Useful enough to recommend to several people I know who would appreciate it, and a stop at fastbuystore added more material I will pass along too, the kind of writing that earns word of mouth is the kind that actually delivers on its promises which is what this site does without any drama or fanfare attached.

  28. Bookmark added in three places to make sure I do not lose the link, and a look at chestnutharborcraftcollective 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.

  29. High quality writing, no marketing speak and no buzzwords that mean nothing, and a stop at firminlets kept that going, simple direct content that actually communicates something is harder to find than it should be and this is one of the rare places that gets it right consistently across many different posts.

  30. My usual pattern is to skim and bounce but this site has reset that pattern temporarily, and a stop at zencovegoodsgallery maintained the slower reading mode, content that changes how I read is content with structural influence and this site has clearly nudged my reading behaviour toward something better at least for the duration of these visits.

  31. Glad the writer did not feel the need to argue with imaginary critics in the post itself, and a stop at goldenharbortradehall kept the same focused approach going, defensive writing wastes the reader time and confidence on positions that did not need defending and this post has clearly avoided that common failure.

  32. Alright listen up because I’m about to save you a massive headache. Miami rental game is wild — half these local clowns show you a custom Mercedes online and hand you a busted sedan with mismatched tires. Plus the fine print says you can’t even drive outside the city limits without extra fees. Fool me four times? Not happening, lesson learned. If you are trying to find a legitimate vehicle without getting ripped off, do some real digging first and read actual customer reviews. Miami without a decent whip is basically a punishment, especially since the AC must be ice cold and you want zero mileage games.

    Most of these local agencies are just polished websites hiding the same overpriced junk, until I finally stumbled on one provider that doesn’t play games. If you are looking for the only straight-up source for premium wheels in South Florida, check the current details here: exotic cars in miami rental exotic cars in miami rental. Also, definitely bring polarized shades unless you enjoy driving completely blind into the sunset. Just drive safe out there and maybe pass on that overpriced roadside assistance add-on. hope this helps some of you save a few bucks.

  33. Appreciated the way each section connected smoothly to the next without abrupt jumps, and a stop at oakcovemarkethall kept that flow going nicely, transitions are something most blog writers ignore but the difference is huge for the reader who is trying to follow a sustained line of thought today across many different topics.

  34. 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 autumncovevendorstudio 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.

Deixe um comentário

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