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

  1. Without overstating it this is a quietly excellent post, and a look at mapleaisle extended that quiet excellence, content that earns superlatives without demanding them through marketing language is content that has truly earned them through the substance and this site has clearly produced work in that earned excellence category today.

  2. Grateful for posts like this one, they remind me there are still places online run by people who care about quality, and a look at tidevendor reflected the same standards, you can tell the difference between content made for readers and content made just for search engines today and this is the former.

  3. Now noticing the careful balance the post struck between confidence and humility, and a stop at qavlizo maintained the same balance, finding the line between asserting and admitting is hard and this site has clearly developed the calibration to walk that line consistently which produces a more persuasive reading experience for me.

  4. Generally I bookmark sparingly to avoid building up a bookmark graveyard but this one earned a permanent slot, and a stop at clockbrace extended that permanence designation, the few sites I keep permanent bookmarks for are sites I expect to use repeatedly and this one has clearly cleared that expectation bar today.

  5. Considered alongside other sources I have been reading this one consistently rises to the top, and a stop at gulfkoala maintained that top ranking, the informal ongoing comparison between sources is something I do whenever reading on a topic and this site keeps coming out near the top of those comparisons over many sessions.

  6. However measured this site clears the bar I set for sites I take seriously, and a stop at dealzaro continued clearing that bar, the metrics I use for site quality are admittedly informal but they are consistent and this site has cleared them on multiple measurements across multiple visits which is meaningful for my evaluation.

  7. Took a chance on the headline and was rewarded, and a stop at urbanso kept the rewards coming as I clicked through, the kind of place where every link leads somewhere worth the click is a small luxury on the modern web where so many sites are mostly empty calories disguised as content.

  8. A piece that did exactly what it promised in the headline without overshooting or underdelivering, and a look at gapjumbo continued that calibration, alignment between promise and delivery is a basic editorial virtue that many sites fail at and this site has clearly mastered the matching of expectation and substance throughout pieces.

  9. Reading this with a notebook open turned out to be the right move, and a stop at easybuyingcorner added more material to the notes, content that justifies active note taking from a passive reader is content with real informational density and this site is producing notes worthy material at a high rate consistently.

  10. Worth flagging that this approach to the topic is fresh without being contrarian, and a stop at vuzmixo extended the same fresh angle, finding original perspective on familiar subjects is rare and this site has clearly developed its own way of seeing rather than echoing the dominant takes from elsewhere consistently.

  11. Just want to acknowledge that the writing here is doing something right, and a quick visit to ironfleet confirmed the same standards run across the broader site, recognising good work is something I try to do when I find it because the alternative is silence and silence rewards mediocrity.

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

  13. The lack of unnecessary jargon made the post accessible without sacrificing accuracy, and a look at easybuyingcorner continued in the same accessible style, technical topics often hide behind specialised vocabulary but here the writer trusts the reader to keep up with plain language and that trust pays off nicely throughout the entire post.

  14. A piece that suggested careful editing without showing the marks of the editing, and a look at tirqano continued that invisible polish, the best editing disappears into the prose and this site reads as having been edited with skill that does not announce itself which is the highest compliment I can offer any blog content.

  15. Reading this felt easy in the best way, no friction and no confusion at any point, and a stop at ironfleet carried that same comfort across more pages, the kind of editorial flow that lets you absorb information without fighting the format which is increasingly hard to find on the open web today across topics.

  16. A thoughtful piece that did not strain to be thoughtful, and a look at fairvendor continued that effortless quality, when thinking shows up in writing without the writer drawing attention to it you know you are reading something genuinely considered rather than something performing the appearance of consideration which is also common online.

  17. This actually answered the question I had been searching for, and after I checked neatglyphs I had a few more pieces I had not realised I needed, that is the sign of a site that knows what its readers want before they even know how to ask it which is impressive.

  18. Beats most of the alternatives on the topic by a noticeable margin, and a look at thoughtfuldesigncollective did not change that at all, this is one of the better corners of the open internet for this kind of content and I am glad I clicked through rather than skipping past quickly like I usually do.

  19. Closed the laptop after this and let the ideas settle for a few hours, and a stop at buymixo similarly rewarded reflective time, content that benefits from sitting with rather than racing past is the kind I want more of and the kind that this site appears to consistently produce week after week here.

  20. I came here looking for a quick answer and ended up reading the whole post because it was actually interesting, and after gapkraft I had a much fuller picture, no stress and no confusion just a clear walk through the topic that made everything fall into place without much effort.

  21. Came across this through a roundabout path and now it is on my regular rotation, and a stop at shopvato 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.

  22. The conclusions felt earned rather than tacked on at the end like an afterthought, and a look at gullgoal kept that careful structure going, you can tell when a writer has thought about the shape of their post versus just letting it ramble out and hoping for the best at the end which most do.

  23. Strong recommendation from me, anyone curious about the topic should make time for this, and a look at kalqavo only sharpens that recommendation further, the kind of resource that holds up against careful scrutiny rather than crumbling at the first critical question is rare and worth pointing other people toward when the topic comes up.

  24. Honestly informative, the writer covers the ground without showing off, and a look at urbantix 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.

  25. Now feeling confident that this site will continue producing work I will want to read, and a look at gapkraft extended that confidence into the future, projecting forward from current quality to expected future quality is something I do for sites I genuinely follow and this one has earned that forward looking trust clearly today.

  26. Found a couple of useful angles in here I had not considered before reading carefully, and a quick stop at shopvato added more, this is one of those sites where the value compounds the more you read rather than peaking at one viral post and then offering nothing else of substance afterwards which is common.

  27. Came here from another site and ended up exploring much further than I planned, and a look at morqino only encouraged more exploration, the kind of place where one click leads to another not through manipulative design but through genuinely interesting content is rare and worth highlighting when found like this somewhere on the open internet.

  28. Closed the post with a small satisfied sigh, and a stop at lovqaro produced the same gentle exhale, content that ends well is content that respects the rhythm of reading and the writers here have clearly thought about how their pieces close rather than just trailing off when they run out of things to say.

  29. A particular kind of restraint shows up in the writing, and a look at vuznaro maintained the same restraint across pages, knowing what not to say is just as important as knowing what to say and this site has clearly developed strong instincts on both sides of that editorial line throughout pieces I have read.

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

  31. Picked this up while looking for something else and ended up reading every paragraph because it was actually informative, and after eagerkilt I was sure I would come back, that does not happen often when most sites bury the useful parts under endless ads and pop ups today and across most categories online.

  32. Strong recommendation from me, anyone curious about the topic should make time for this, and a look at kalqavo only sharpens that recommendation further, the kind of resource that holds up against careful scrutiny rather than crumbling at the first critical question is rare and worth pointing other people toward when the topic comes up.

  33. Liked everything about the experience, from the opening through to the closing notes, and a stop at urbantix extended that into more pages, finding a site where the editorial vision shows through every choice rather than feeling random is an increasingly rare experience and one I am glad to have today during this particular reading session.

  34. Felt the writer respected the topic without being precious about it, and a look at dailyshoppinghub continued that respectful but unfussy treatment, finding the right register for serious topics is hard and this site has clearly figured out how to take the topic seriously while still being readable for casual visitors regularly.

  35. Stands apart from similar pages by actually being useful, that is high praise these days, and a look at heronhilt kept that standard going, you can tell when a site is built around the reader versus around metrics and this one clearly belongs to the first category for sure based on what I read.

  36. Felt no urge to argue with the conclusions even though I started the post slightly skeptical, and a look at flarefest maintained that pattern, writing that earns agreement through clarity of argument rather than rhetorical pressure is the kind I find most persuasive and the kind I want to read more of these days.

  37. Came in for one specific question and got answers to three I had not even thought to ask, and a look at mexvoro extended that bonus value pattern, the kind of resource that anticipates reader needs rather than just answering the literal question asked is the gold standard and this site reaches it.

  38. My usual pattern is to skim and bounce but this site has reset that pattern temporarily, and a stop at elitefests 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.

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

  40. Reading carefully this time rather than scanning, and the depth shows up in places I missed first time around, and a look at vuznaro 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.

  41. Appreciated how the post felt complete without overstaying its welcome, and a stop at heronhilt confirmed that economical approach runs across the site, knowing when to stop is a skill many writers never develop but here the discipline is obvious and welcome from the perspective of a busy reader trying to learn things efficiently.

  42. Really appreciate the absence of stock photos that have nothing to do with the content, and a quick visit to buyrova maintained the same restraint, visual filler is a tell that the writing cannot stand on its own and the lack of it here suggests the team has confidence in their content quality alone.

  43. Halfway through reading I knew this would be one to bookmark, and a look at mexvoro confirmed that early intuition, when bookmark intent forms before finishing a post you know the writing has cleared a quality bar that most content fails to clear and this site has cleared it on multiple visits already.

  44. Liked how the writer used real examples instead of theoretical ones to make the points stick, and a stop at tirvaxo 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.

  45. Skipped the social share buttons but might come back to actually use one later, and a stop at lovzari extended that share urge, content that triggers genuine sharing impulses rather than performative ones is content that has actually moved me and not many posts in a typical week do that for me actually.

  46. Стоит ли совмещать SEO с контент-маркетингом — есть ли реальная синергия?

  47. Now realising the post has been quietly doing important work in my mind for the past hour, and a stop at urbanvani extended that quiet processing, content that continues to do work after I close the tab is content with afterlife in the mind and this site is producing those long lived effects at a meaningful rate.

  48. A welcome contrast to the loud takes that have dominated my feed lately, and a look at shopvilo extended that calm voice, content that arrives without yelling has become unusual in the modern attention economy and this site is one of the few places I have found that consistently delivers without raising its voice.

Deixe um comentário

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