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.

7.207 Comentários

  1. Worth pointing out the careful word choice in this post, no buzzwords and no jargon, and a look at wildmooncorners continued that disciplined vocabulary, sites that resist the pull of trendy language are sites that will read well in five years and this one is clearly built for that kind of long durability.

  2. A relief to read something where I did not have to fact check every claim mentally, and a look at freshgiftcollection continued that reliable feeling, sites where I can lower my guard and trust the content are rare and this one is earning that trust paragraph by paragraph through consistent careful work behind the scenes.

  3. growwithpurpose growwithpurpose

    If you scroll past this site without looking carefully you will miss something, and a stop at growwithpurpose extended that mild warning, the surface of the site does not advertise its quality loudly which means careful attention is required to recognise what is being offered here which is itself a kind of editorial signal.

  4. Thank you for the genuine effort here, it shows in every paragraph and not just the headline, and after my visit to midnighttrendhouse I was sure this site cares about getting things right rather than chasing clicks, which is the main reason I will come back later this week to read more.

  5. Found the use of subheadings really helpful for scanning back through the post later, and a stop at timberpathstore kept that reader friendly approach going, navigation is something many blog writers ignore but small structural choices make a noticeable difference for someone returning to find a specific point again days or weeks later.

  6. I have been curious about these trends, and you have really helped me. I have just told a few of my friends about this on FaceBook and they love your content just as much as I do.

  7. Worth recognising the absence of the usual blog tropes here, and a look at discovertrendhub continued that fresh quality, sites that avoid the standard moves of the medium read as more original even when the content is on familiar topics and this one has clearly chosen its own path through the conventional terrain skilfully.

  8. urbantrendstore urbantrendstore

    Came in skeptical of the angle and left mostly persuaded, and a stop at urbantrendstore pushed me a bit further in the same direction, content that can move a critical reader by argument rather than rhetoric is rare and worth pointing out because it indicates real substance underneath the surface presentation here.

  9. Now noticing how rare it is to find a site that does not feel rushed, and a look at timelessgrovehub extended that calm pace, content produced without time pressure has a different quality than content shipped to meet a deadline and this site reads as written without urgency which produces a different and better experience for readers.

  10. Came across this through a roundabout path and now it is on my regular rotation, and a stop at rusticriverstudio sealed that decision, the open web still produces serendipitous discoveries when you let the citations and references guide you rather than relying purely on algorithmic feeds for new content recommendations always.

  11. A piece that was confident enough to leave some questions open rather than forcing closure, and a look at explorelimitlessgrowth 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.

  12. 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 wildcoastworkshop 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.

  13. Really appreciate the lack of pop ups, modals, cookie banners stacking on top of each other, and a quick visit to urbanstyleoutlet confirmed the same clean approach across the rest of the site, technical decisions about user experience are part of what makes content actually pleasant to engage with for sure.

  14. A well calibrated piece that knew its scope and stayed inside it, and a look at everwildgrove maintained the same scope discipline, scope creep is one of the failure modes of long blog posts and this site has clearly invested in the editorial discipline to prevent it which shows up in tightly contained pieces.

  15. Appreciated the way each section connected smoothly to the next without abrupt jumps, and a stop at budgetfriendlyhub 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.

  16. Reading carefully this time rather than scanning, and the depth shows up in places I missed first time around, and a look at tallcedarmarket rewarded the same careful approach, content that holds up to multiple reads is content I want more of in my regular rotation rather than disposable scroll fodder daily.

  17. Worth a slow read rather than the fast scan I usually default to, and a look at shopwithstyletoday earned the same slower pace from me, content that resets my reading speed downward is content with substance worth absorbing and this site has produced that effect on me multiple times now over the last week here.

  18. Just sat back at the end of the post and felt grateful that someone took the time to write it, and a look at lushvalleychoice extended that gratitude across more of the site, recognising effort behind quality work is part of what makes the open web a community rather than just a marketplace today.

  19. Solid recommendation from me to anyone working in the area, the perspective here is grounded, and a look at budgetfriendlyhub adds even more useful angles, the kind of site that becomes a reference rather than just a one time read which is a higher bar than most blogs ever reach today on the modern web.

  20. Picked a single sentence from this post to remember, and a look at urbanstonegallery 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.

  21. Probably one of the more reliable sources I have found for this kind of careful coverage, and a look at discoverbettervalue reinforced the reliability, the small group of sources I would describe as reliable for a given topic is curated carefully and this site has earned a place in that small group through consistent performance.

  22. Honest take is that I will probably forget most of what I read online today but this post is one I will remember, and a stop at evergreenstyleplace kept that same memorable quality going, certain writing leaves a residue in the mind in a way most content simply does not manage.

  23. Stayed longer than planned because each section earned the next, and a look at lushvalleychoice 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.

  24. Geraldfaf Geraldfaf

    Публикация охватывает основные направления развития современной медицины. Мы обсудим значимость научных исследований, инноваций в лечении и роли общественного участия в формировании системы здравоохранения.
    Смотрите также… – Похмельная служба Краснодар

  25. Picked a single sentence from this post to remember, and a look at urbanstonegallery 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.

  26. Bookmark folder created specifically for this site, and a look at evergreenstyleplace confirmed the dedicated folder was the right call, dedicated folders for individual sites are a level of organisation I rarely deploy and this site has earned that level of dedicated tracking based on the consistency I have seen so far across sessions.

  27. Liked that there was nothing performative about the writing, and a stop at discoverbettervalue continued that genuine quality, performative writing tries to be witnessed rather than read and the difference between performance and substance is huge for the careful reader and this site has clearly chosen substance every time clearly.

  28. Felt the writer respected me as a reader without making a show of doing so, and a look at discoverstylehub continued that quiet respect, this is the kind of small but meaningful detail that separates the sites I bookmark from the ones I close after a single skim and never return to again no matter how interesting the headline.

  29. Granted I am giving this site more credit than I usually give new finds, and a look at moonviewdesigns continued earning that credit, the calibration of how much trust to extend after limited exposure is something I do carefully and this site has earned more trust on shorter exposure than most due to consistent quality across.

  30. groweverydaynow groweverydaynow

    Good clean post, no errors and no awkward phrasing that breaks the reading flow, and a stop at groweverydaynow kept the same standard, definitely the kind of editorial care that earns a return visit because it tells me the writer is paying attention to details that matter to readers rather than just rushing publication.

  31. Appreciate that you did not pad this with fluff to hit a word count, the post says what it needs to say and stops, and a look at whitestonechoice did the same, brevity here feels intentional not lazy which is a distinction many writers miss completely sometimes when they are working under deadlines.

  32. Now thinking about how to apply some of this to a project I have been planning, and a look at brightfloralhub added more material for the planning, content that connects to my actual creative work rather than just being interesting in the abstract is the kind that earns priority placement in my reading rotation consistently going forward.

  33. Now sitting back and recognising that this was a small but real win in my reading day, and a stop at moonviewdesigns 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.

  34. Found this through a friend who recommended it and now I see why, and a look at shopwithjoy 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.

  35. Really appreciate that the writer did not overstate the importance of the topic to make the post feel weightier, and a quick visit to fullcirclemart 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.

  36. A genuine compliment to the writer for keeping the post focused on what mattered, and a look at lagooncrown continued that disciplined focus, focus is a editorial choice that compounds across many small decisions and this site has clearly made those small decisions consistently across what I have read so far this week here.

  37. classystylemarket classystylemarket

    Liked how the writer used real examples instead of theoretical ones to make the points stick, and a stop at classystylemarket added even more concrete examples, this is the kind of practical approach that respects readers who actually want to apply what they learn rather than just nodding along passively without doing anything useful.

  38. Thanks for the breakdown, it gave me a clearer picture of something I had been confused about for a while now, and a stop at edendome closed the remaining gaps in my understanding nicely, no need to hunt around twenty other articles to put the pieces together which is a real time saver.

  39. Worth bookmarking and sharing with anyone interested in the topic, that is my honest take, and a stop at cosmohorizon reinforces that, the kind of generous resource that makes the open web feel worth defending against the constant pressure to retreat into walled gardens and curated feeds today everywhere I look across all my devices.

  40. Now feeling the small relief of finding writing that does not condescend, and a stop at firminlet extended that respect for readers, content that treats its audience as capable adults rather than as people to be managed produces a different reading experience and this site has clearly chosen the respectful approach across all pieces.

  41. Found something new in here that I had not seen explained this way before, and a quick stop at irisarbor expanded the idea even further, the kind of writing that nudges your thinking forward a bit without forcing the issue is exactly what I look for online today and rarely actually find anywhere.

  42. Felt the writer was being honest with the reader which is rare enough that I want to acknowledge it, and a look at shopwithjoy continued that honest feel, content built on actual knowledge rather than aggregated summaries is something I value highly and rarely come across in regular searches on the open internet these days.

  43. classystylemarket classystylemarket

    Reading this in my last reading slot of the day was a good way to end, and a stop at classystylemarket provided a satisfying close to the reading session, content that ends a day well rather than agitating it before sleep is the kind I value increasingly and this site fits that role for me consistently now.

  44. Now appreciating that the post did not try to imitate any other style I might recognise, and a stop at softfeathermarket continued that distinct voice, content with its own register rather than borrowed from elsewhere is content with real authorial presence and this site has clearly developed that presence through what feels like patient editorial work.

  45. Came in confused about the topic and left with a much firmer grasp on it, and after wildshoregalleria I felt I could explain this to someone else without hesitation, that is the gold standard for any educational content and most sites simply fail to reach it ever which is unfortunate but true.

  46. Even from a single post the editorial care is clear, and a stop at brightwindemporium 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.

Deixe um comentário

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