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

  1. Now planning to write about the topic myself eventually using this post as a reference, and a look at mallivo 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.

  2. Closed my email tab so I could read this without interruption, and a stop at nagapinto earned the same protected attention, when content is good enough to defend against the usual digital distractions you know it deserves better than the half attention most online reading gets in a typical busy day.

  3. Useful information presented in a way that does not feel like a sales pitch, that is what I appreciated most, and a stop at modloop was the same, no upsell and no fake urgency just steady content laid out properly for someone trying to actually learn from it rather than just be sold to.

  4. Honestly impressed, did not expect to find this level of care on the topic, and a stop at trivent cemented the impression, you can tell within the first few paragraphs whether a site is going to be worth the time and this one delivered on that early promise nicely throughout the rest of what I read.

  5. A piece that did not require external context to follow, and a look at poppymedal maintained the same self contained quality, content that stands alone without forcing readers to chase prerequisites is more accessible and this site has clearly thought about how each piece can serve a fresh visitor rather than only existing members.

  6. Worth recognising that the post handled a familiar topic without reaching for any of the obvious hot takes, and a stop at cartvilo continued that fresh treatment, sites that find new angles on subjects others have exhausted are sites worth following carefully and this one has clearly developed that exploratory instinct through patient practice.

  7. Well structured and easy to read, that combination is rarer than people think, and a stop at padreledge 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.

  8. More original than the recycled takes I keep finding on the topic elsewhere, and a quick look at nagapinto confirmed it, the kind of site that has its own voice rather than echoing whatever is trending which makes it stand out as a refreshing change from the usual rotation of generic content I see daily.

  9. Bookmark earned, calendar reminder set, share queued, all from one good post, and a look at millpeach did the same, when a single reading session triggers multiple downstream actions you know the content has actually moved me beyond the page and this site is moving me at that higher level reliably.

  10. Reading this prompted me to subscribe to my first newsletter in months, and a stop at cartvilo 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.

  11. Felt the post had been written without looking over its shoulder, and a look at pianoledge 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.

  12. Took a screenshot of one section to come back to later, and a stop at framegable prompted another saved tab, the urge to capture and revisit specific pieces of content is something I rarely feel but when I do it tells me the work is worth more than the average passing read for sure.

  13. The overall feel of the post was professional without being stuffy, and a look at purplemilk kept that approachable expertise going, finding the right register for technical content is hard but this site has clearly figured out how to sound knowledgeable without slipping into that distant lecturing tone that loses readers in droves every time.

  14. 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 padreledge 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.

  15. Found this really helpful, the explanations are simple but they actually answer the questions a normal reader would have, and after I followed purplemilk I had a clearer sense of the topic, no extra fluff just useful points laid out in a sensible order that made the time worth it.

  16. During a reading session that included several other sources this one stood out, and a look at navqiro continued the standout quality, the side by side comparison of sources during research is a useful exercise and this site has been winning those comparisons for me consistently across multiple research sessions during the last week.

  17. Big thanks to whoever wrote this, you saved me a lot of time hunting for the same info on other sites, and a stop at goldenrootboutique only added more useful detail without going off topic, that kind of focus is honestly hard to come across these days when most posts wander everywhere.

  18. Appreciated how the writer anticipated the questions a reader might have along the way, and a stop at palmcodex continued that thoughtful approach, you can tell when content has been edited with the reader in mind versus just published as a first draft and this is clearly the former approach across what I read.

  19. Better signal to noise ratio than most places I check on this kind of topic, and a look at contemporarygoodsmarket kept that going, every paragraph here carries something worth reading rather than padding out the page to hit some arbitrary length target that search engines reward but readers ignore as soon as they notice it.

  20. A piece that was confident enough to leave some questions open rather than forcing closure, and a look at narrowlake 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. Following the post through to the end without my attention drifting once, and a look at xenoframe earned the same uninterrupted attention, content that holds attention without manipulating it is content with substantive pull and this site has demonstrated that substantive pull across multiple pieces in a single reading session reliably here today.

  22. Skipped a meeting reminder to finish the post, and a stop at vankiro held me past another reminder, when content beats meetings the writer is doing something extraordinary because meetings have institutional support behind them and yet good writing can still occasionally win that competition for attention which I find heartening today.

  23. Reading this slowly to absorb the structure, and the structure is doing real work alongside the words, and a look at contemporarygoodsmarket maintained the same architectural quality, when sentence shapes and paragraph rhythms reinforce the meaning rather than just transporting words you know you are reading skilled work today.

  24. Thanks for the simple approach, too many sites bury the actual point under layers of unnecessary words, but here every line earns its place, and a look at pianoloud showed the same care for the reader which is something I will remember the next time I need answers on a topic.

  25. Now thinking I want more sites built on this kind of editorial foundation, and a stop at modluma extended that wish into a broader hope, sites built on substance and care rather than on metrics and growth are the kind of sites I want to see more of and this one is a small example worth supporting.

  26. Started this morning and finished at lunch with a small sense of having spent the time well, and a look at narrowmotor extended that satisfaction into the afternoon, content that fits naturally into the rhythm of a working day rather than demanding a dedicated reading block is increasingly the kind I prefer.

  27. Really like that the writer trusts the reader to follow simple logic without restating every previous point, and a stop at xomvani kept that respect going, treating an audience as capable adults rather than as people who need constant hand holding makes a noticeable difference in the reading experience for me.

  28. Now planning to recommend this site in a context where my recommendations are taken seriously, and a stop at nylonmoss confirmed I should make that recommendation soon, the small but real act of recommending content into spaces where my taste matters is something I take seriously and this site is worth the recommendation.

  29. Honestly enjoyed every minute spent here, that is not something I say lightly, and a look at mavlumo confirmed I will be back, the bar for spending time online is high for me these days but this site clears it without effort which is high praise indeed from this reader who is usually rather demanding.

  30. Just want to recognise that someone clearly cared about how this turned out, and a look at maplecresttradingcorner confirmed that care extends across the broader site, you can feel the difference between content shipped to hit a deadline and content released because the writer was actually proud of the result for once.

  31. Adding to the bookmarks now before I forget, that is how good this is, and a look at lushpassion confirmed the rest of the site is worth saving too, this is one of those rare finds that justifies the time spent searching the web for once which is a relief in the current environment.

  32. Even across multiple posts the writers voice has remained consistent in a way I appreciate, and a stop at frescoheron continued that voice, sites that maintain editorial consistency across many pieces have something most sites lack and this one has clearly worked out how to keep its voice steady across what reads as a growing archive.

  33. Thanks for laying this out in a way that someone newer to the topic can follow, and a stop at prairiemyrrh kept that accessibility going, writing that meets readers at different experience levels without condescending is hard to do well and the writers here have clearly thought about who they are writing for.

  34. Decided after reading this that I would check this site weekly going forward, and a stop at stylevilo reinforced that commitment, deciding to add a site to a regular rotation requires meeting a quality bar that very few places clear and this one cleared it cleanly without any noticeable effort or marketing push behind it.

  35. Genuinely glad I clicked through to read this rather than skipping past, and a stop at cadetarenas 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.

  36. Skipped a meeting reminder to finish the post, and a stop at nylonmoss held me past another reminder, when content beats meetings the writer is doing something extraordinary because meetings have institutional support behind them and yet good writing can still occasionally win that competition for attention which I find heartening today.

  37. Following a few of the internal links revealed more posts of similar quality, and a stop at mavlumo 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.

  38. Came away with a small but real shift in perspective on the topic, and a stop at nexcove pushed that shift a bit further, the kind of subtle reframing that good writing does to a reader without making a big deal of it is something I always appreciate when it happens which is sadly not that often.

  39. Just one of those reads that left me feeling slightly more capable rather than overwhelmed, and a look at prairiemyrrh kept that empowering feel going, the difference between content that builds the reader up and content that intimidates them is huge and this site clearly knows which side of that line to stand.

  40. Worth saying that the post fit naturally into a rhythm of careful reading, and a stop at dealdeck extended the same rhythm, content that pairs well with how I actually read rather than demanding a different mode is content well calibrated to its likely audience and this site has clearly thought about that consistently.

  41. Speaking from the perspective of a fairly demanding reader the writing here clears the bar consistently, and a look at vanlizo continued clearing that bar, the calibration of demanding reader is something I apply to all sources and this site has been one of the few that handles the demanding reading well across pieces sampled.

  42. Quietly impressive in a way that does not announce itself, and a stop at cadetarenas extended that quiet impressiveness, the kind of quality that emerges through sustained attention rather than first impressions is the kind I trust more deeply and this site has been earning that deeper trust across multiple sessions over time consistently.

  43. Honest opinion is that this is the kind of post that builds long term trust with readers, and a look at n3rdmarket reinforced that perception, the slow accumulation of trust through consistent quality is the only sustainable way to build a real audience and this site is clearly playing that long game.

  44. Honestly impressed by how much useful content sits in such a small post, and a stop at trendmixo confirmed the rest of the site packs a similar punch, density without confusion is a hard balance to strike and this site has clearly cracked the code on it across many different topic areas covered.

  45. A slim post with substantial content per word, and a look at minimparch maintained the same density, the content per word ratio is something I track informally and this site scores high on that ratio compared to most sources I read regularly which is a quiet indicator of careful editorial work behind the scenes.

  46. Reading this in pieces over a coffee break and finding it consistently rewarding, and a stop at thoughtfullydesignedstore extended that into related material I will return to later, the kind of site that fits naturally into small reading windows without requiring a long uninterrupted block is genuinely useful for how I actually browse.

  47. Honestly this was the highlight of my reading queue today, and a look at dabbyrd extended that across more pages I will return to, ranking what I read against what else I read each day is something I do informally and this site keeps moving up in those rankings the more I explore it.

  48. Found the post genuinely useful for something I was working on this week, and a look at xovmora added more material I will reference, content that connects to my actual life and work rather than just being interesting in the abstract is the kind I will pay attention to and return to repeatedly.

  49. Reading this confirmed something I had been suspecting about the topic, and a look at elaniris pushed that confirmation toward greater confidence, content that lines up with independently held intuitions earns a special kind of trust and I will return to writers who consistently land that way for me without overselling positions.

  50. Now noticing how rare it is to find a site that does not feel rushed, and a look at nationmagma 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.

Deixe um comentário

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