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.

8.825 Comentários

  1. Now recognising the specific pleasure of reading writing that shows real care for sentence shapes, and a look at stylemixo extended that craft pleasure, sentence level writing quality is something most blog content ignores entirely and this site has clearly invested in the prose layer alongside the substance which is rare today.

  2. Most attempts at writing on this topic feel like they are missing something and this post finally identified what was missing, and a look at mutelion extended that diagnostic clarity, content that names what is wrong with adjacent treatments while doing better itself is content with both critical and constructive value and this site has both.

  3. Different in a good way from the cookie cutter content that fills most blogs covering this area, and a stop at urbivio kept showing me why, original thoughtful writing exists if you know where to look and this site has earned a place on my short list of those rare exceptions worth defending.

  4. Now planning to share the link with a small group of readers I trust, and a look at palmbazaar suggested more material to share with the same group, recommending content into a curated circle requires confidence in the recommendation and this site is making me confident in those personal recommendations on multiple separate occasions now.

  5. Liked the post enough to read it twice and the second read found new things, and a stop at xelvani 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.

  6. My professional context would benefit from having this kind of resource available, and a look at seotrail extended the professional applicability, the rare site that contributes meaningfully to professional work rather than just personal interest is content with multiplied value and this one is providing that professional utility consistently across multiple pieces.

  7. Reading this brought back an idea I had set aside months ago, and a stop at jumbohelm added more substance to that idea, content that revives dormant projects in my own thinking is content with serious creative value and this site is contributing to my own work in ways I had not expected when first clicking through.

  8. Definitely returning here, that is decided, and a look at gladhalo only made the case stronger, this is one of those rare websites that rewards regular visits rather than feeling stale after the first read which is something I cannot say about most of the places I bookmark today across all my topics.

  9. Saving this link for the next time someone asks me about this topic, and a look at timbertowncorner expanded what I will be sharing with them, this is the kind of resource that makes a real difference when you are trying to point a friend to something useful and reliable rather than generic marketing pages.

  10. Genuinely glad I clicked through to read this rather than skipping past, and a stop at milknorth confirmed I should keep clicking through to more pages here, the kind of resource that justifies its place in my browser history rather than feeling like wasted time which is the highest compliment I offer any site online today.

  11. Just want to say thank you for putting this together, posts like these make searching online actually worth it sometimes, and a quick look at curlbyrd kept that going, useful and easy to read without any of the tricks that ruin most blog comment sections lately on the wider open web.

  12. Now appreciating that the post left me with enough to say in a follow up conversation, and a look at torlumo added more material for those follow ups, content that prepares me for related conversations rather than just informing me alone is content with social utility and this site provides that social armament reliably for me.

  13. Well structured and easy to read, that combination is rarer than people think, and a stop at heathfoam confirmed the same standard runs across the rest of the site, definitely the kind of place I will be coming back to when this topic comes up in conversation later again over the weeks ahead.

  14. Coming back to this one, definitely, and a quick visit to cartrova 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.

  15. Skipped breakfast still reading this and finished hungry but satisfied, and a stop at thirtymale kept me past breakfast time, content that displaces basic biological needs is content with serious attentional pull and the writers here are clearly capable of producing that level of engagement which is genuinely impressive these days.

  16. Now sitting back and recognising that this was a small but real win in my reading day, and a stop at qinmora extended that quiet win, the cumulative effect of small reading wins versus the cumulative effect of small reading losses is real over time and this site is contributing to the wins side of that ledger.

  17. Worth saying this site reads better than most paid newsletters I have tried, and a stop at fossgusto confirmed that comparison, the bar for free content is often lower than for paid but this site clears the paid bar consistently and that says something about the editorial approach behind the work being published here regularly.

  18. Now setting up a small reminder to revisit the site on a slow day, and a stop at zimlora confirmed the reminder was a good idea, planning return visits is a small organisational act that signals trust in ongoing quality and this site has earned that planned return through consistent performance across the pieces I have read so far.

  19. Glad the writer kept this short rather than padding it out, the points stand on their own without needing extra context, and a look at cartrova kept the same approach going, brevity is a sign of confidence in the substance and the team here clearly trusts their content to land without filler.

  20. I appreciate the clarity here, everything is explained in simple terms without unnecessary detail, and after a quick stop at stylerivo the points came together nicely for me, the writing keeps things straightforward and respects the reader from start to finish without ever talking down to anyone.

  21. Felt mildly happier after reading, which sounds silly but is true, and a look at nextleveltrading extended that small mood lift, content that improves rather than degrades my mental state is content I want more of and the cumulative effect of reading sites that lift versus sites that drag is real over time.

  22. Now feeling that this site is the kind I want to make sure does not disappear, and a look at thirtymale reinforced that quiet protective feeling, the rare sites whose disappearance would actually matter to me are the sites I want to support through return visits and recommendations and this one has joined that small protected list.

  23. Picked this for my morning read because the topic seemed worth the time, and a look at myrrhlens confirmed the choice was right, my morning reading slot is precious and giving it to this site felt like a good investment rather than a waste which is a higher endorsement than I usually offer for content.

  24. Reading this gave me the rare experience of fully agreeing with all the conclusions, and a stop at softspringemporium continued that agreement pattern, content that aligns with my existing views without seeming designed to do so is just content that happens to be reasonable and this site reads as reasonable rather than ideological mostly.

  25. Bookmark added with a small mental note that this is a site to keep, and a look at xelzino reinforced the keep status, the verb keep rather than visit captures something about how I think about this kind of site and it is a higher tier of relationship than I have with most places online today.

  26. Glad I clicked through from where I did because this turned out to be worth the time spent, and after torqavi I had a fuller picture, the kind of content that earns its visitors through delivering value rather than chasing them through aggressive advertising or constant pop ups appearing everywhere on the screen lately.

  27. Felt the writer was speaking my language without trying to imitate it, and a look at zimlora continued that natural fit, when a writers default voice happens to match what you find easy to read the experience feels frictionless and that is something I notice and remember about specific sites going forward.

  28. Top notch writing, every paragraph carries weight and nothing feels like filler, and a stop at nextleveltrading reflected that same care, a rare thing on the open web these days where most pages exist for clicks rather than actual reader value or anything close to that which is honestly a real shame.

  29. Just want to say thank you for putting this together, posts like these make searching online actually worth it sometimes, and a quick look at navmixo kept that going, useful and easy to read without any of the tricks that ruin most blog comment sections lately on the wider open web.

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

  31. Even from a single post the editorial care is clear, and a stop at palmbranch extended that care across more pages, the kind of attention to quality that shows up in every paragraph is what separates serious sites from the rest and this one has clearly invested in that paragraph level attention across what I have read.

  32. A genuinely unexpected highlight of my reading week, and a look at jumbokelp extended that pattern, the surprise of finding excellent content rather than the predictable mediocre is one of the few real pleasures of casual web browsing and this site delivered that surprise cleanly today which I really do appreciate.

  33. Stayed longer than planned because each section earned the next, and a look at perfectmill kept that pulling effect going across more pages, the kind of subtle pull that good writing exerts on attention is something I find harder and harder to resist when I encounter it on the open web today.

  34. Generally I am cautious about recommending sites on first encounter but this one warrants the exception, and a look at curlclap reinforced the exception making, the rare site that justifies breaking my normal cautious approach is the rare site worth flagging early and this one has prompted exactly that early flagging response from me.

  35. Recommended without hesitation if you care about careful coverage of this topic, and a stop at luzqiro reinforced the recommendation, the bar I set for unhesitating recommendations is fairly high and this site has cleared it through the cumulative weight of multiple consistently good pieces rather than through any single standout post which is meaningful.

  36. Spent a few minutes here and came away with a clearer picture of the topic, the writing keeps things simple without dumbing them down, and after a stop at saveaustinneighborhoods the rest of the points lined up neatly which is something I appreciate when I am short on time and need answers fast.

  37. Felt like I was reading something written by someone who actually thinks about the topic rather than reciting it, and a look at myrrhomen reinforced that impression, the difference between recited content and considered content is huge and this site clearly belongs to the latter category which I appreciate as a careful reader looking for substance.

  38. Picked a single sentence from this post to remember, and a look at zimqano gave me another to keep, content that produces memorable lines is doing more than just transferring information and the small selection of sentences I keep from each reading session is one of the actual returns I get from reading carefully.

  39. Liked the careful word choice throughout, every term seemed picked for a reason rather than thrown in casually, and a stop at pacerlucid continued that precise style, this kind of attention to small details is what separates careful writing from the usual rushed content that dominates blog spaces today across pretty much every topic I follow.

  40. Top tier post, the kind that makes you want to share the link with friends working in the same area, and a stop at ponyosier only made me more confident in doing that, this site is one of the better resources I have seen on the topic recently across both new and older posts.

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

  42. Closed the tab and immediately reopened it ten minutes later because I wanted to reread a part, and a stop at zimqano drew the same return, content that pulls you back after closing it is doing something well beyond the average and worth marking as exceptional in my mental catalogue of reliable sites.

  43. Liked the post enough to read it twice and the second read found new things, and a stop at grippalaces 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.

  44. A small thank you note from me to the team behind this work, the post earned it, and a stop at torzavi suggested more thanks would be in order over time, recognising the people who do good writing online is something I try to remember to do because the alternative is silence and silence rewards mediocrity unfortunately.

  45. Felt the post had been quietly polished rather than aggressively styled, and a look at hiltkindle confirmed the same understated polish, sites whose quality reveals itself slowly rather than announcing itself loudly are the kind I trust more deeply because the trust is not based on first impressions of marketing but actual substance.

  46. Looking for similar voices elsewhere has come up empty in my recent searches, and a stop at wildduneessentials extended the search frustration, the rare site that does what no other does in quite the same way is precious and this one has clearly developed a particular approach that I have not been able to find duplicates of.

  47. Reading this with a fresh mind in the morning brought out details I might have missed in the afternoon, and a stop at trivent earned the same fresh attention, content that rewards being read at full attention rather than at energy lows is content with real density and this site has that density consistently.

  48. Liked the way the post balanced confidence and humility, and a stop at curvecalm maintained the same balance, knowing when to assert and when to acknowledge uncertainty is a sign of mature thinking and the writers here have clearly developed that calibration through what I assume is years of careful work on their craft.

Deixe um comentário

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