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.873 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.

Deixe um comentário

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