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

  1. The examples really helped me grasp the points faster than abstract descriptions would have, and a stop at bauxbee added a few more practical illustrations that drove the message home, the kind of writing that knows its readers learn better through concrete situations rather than vague generalities is rare and worth recognising clearly.

  2. BruceFut BruceFut

    Эта информационная публикация освещает широкий спектр тем из мира медицины. Мы предлагаем читателям ясные и понятные объяснения современных заболеваний, методов профилактики и лечения. Информация будет полезна как пациентам, так и медицинским работникам, желающим поддержать уровень своих знаний.
    Не пропусти важное – капельницы в балашихе

  3. Now setting aside time on my next free afternoon to read more from the archives, and a stop at 1091m2love confirmed that time will be well spent, the rare site whose archive deserves a dedicated reading session rather than just casual sampling is the kind of resource worth scheduling around and this one qualifies clearly.

  4. Now thinking about how to apply some of this to a project I have been planning, and a look at coilbliss 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.

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

  6. Pass this along to colleagues if the topic comes up, the framing here is sensible, and a stop at dewchase adds more useful angles to share, the kind of content that improves conversations rather than just feeding them is what makes a resource genuinely valuable in professional contexts going forward over time and across project boundaries too.

  7. Reading this in a relaxed evening setting was a small pleasure, and a stop at coilbyrd extended the pleasant evening reading, content that fits the tone of relaxed time without becoming forgettable is what I look for in evening reading and this site has the right tone for that particular slot in my daily reading routine.

  8. findamazingoffers findamazingoffers

    Worth a slow read rather than the fast scan I usually default to, and a look at findamazingoffers 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.

  9. Felt no urge to argue with the conclusions even though I started the post slightly skeptical, and a look at amidbrawn 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.

  10. 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 coilbyrd 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.

  11. Found the writing surprisingly fresh for what is by now a well covered topic, and a stop at astrebull kept that freshness going across the related pages, original perspective on familiar ground is hard to come by and this site has clearly earned its place in the conversation rather than just rehashing old ideas.

  12. findamazingoffers findamazingoffers

    Came away with some new perspectives I had not considered before, and after findamazingoffers those ideas felt more complete, the kind of content that stays with you a little while after reading rather than slipping out the moment you switch tabs and move on with your day to whatever comes next.

  13. Felt slightly impressed without being able to point to one specific reason, and a look at domelegends continued that diffuse positive feeling, when content works at a level you cannot easily articulate the writer is doing something with craft rather than just delivering information and that is something I have learned to recognise.

  14. Reading this on a difficult day was a small bright spot, and a stop at astrebull extended that brightness, content that improves a hard day is content that has earned a particular kind of place in my reading habits and this site is occupying that uplifting role for me today which I appreciate clearly.

  15. Strong recommendation, anyone interested in this topic owes themselves a visit, and a stop at dewchip extends that recommendation across more of the site, this is the kind of resource that makes me more optimistic about the state of the open web than I usually am these days actually for once which is genuinely refreshing.

  16. Just want to record that this site is entering my regular reading list, and a look at portpoise 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.

  17. Now sitting with the thoughts the post triggered rather than rushing on to the next thing, and a stop at byrdbush extended that reflective pause, content that earns time for thought after closing the tab is content of higher value than the merely interesting and this site has clearly produced that lasting effect today.

  18. 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 pactpalace 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.

  19. Reading this gave me material for a conversation I needed to have anyway, and a stop at apexhelm added even more talking points, content that connects to upcoming social or professional needs rather than just being interesting in the abstract is the kind that earns priority placement in my attention these days routinely.

  20. Bookmark folder created specifically for this site, and a look at nighttoshineatlanta 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.

  21. Anyone curious about this topic would do well to start here, the foundation laid is solid, and a stop at knackdomes would round out their understanding nicely, this is the kind of resource I would point a friend toward without hesitation if they asked me where to begin learning about anything in this area.

  22. During the time spent here I noticed the absence of the usual distractions, and a stop at amidbull extended that distraction free experience, content that does not fight my attention with pop ups and modals and aggressive prompts is content that respects me and this site has clearly chosen the respectful approach throughout.

  23. Liked the way the post got out of its own way, and a stop at astrecanal extended that invisible craft, the best writing you barely notice while reading because it is doing its work without drawing attention to itself and this site has clearly mastered that disappearing act across the pieces I have read.

  24. Worth pointing out that the writing reads as confident without being defensive about it, and a look at byrdbush extended that secure tone, content that does not pre emptively argue against imagined critics has a different quality from defensive writing and this site reads as written from a place of real ease.

  25. During a reading session that included several other sources this one stood out, and a look at curbcomet 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.

  26. Generally I am cautious about recommending sites on first encounter but this one warrants the exception, and a look at bravofarms 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.

  27. Will be sharing this with a couple of people who care about the topic, and a stop at covecanal added more material worth passing along, the kind of site that is generous with quality content and does not make you jump through hoops to access it which is appreciated more than the team probably realises.

  28. Pass this along to colleagues if the topic comes up, the framing here is sensible, and a stop at coilcab adds more useful angles to share, the kind of content that improves conversations rather than just feeding them is what makes a resource genuinely valuable in professional contexts going forward over time and across project boundaries too.

  29. RickyPlaxy RickyPlaxy

    В данной публикации мы поговорим о процессе восстановления от зависимости, о том, как вернуть себе нормальную жизнь. Мы обсудим преодоление трудностей, значимость поддержки и наличие программ реабилитации. Читатели смогут узнать о ключевых шагах к успешному восстановлению.
    Уникальные данные только сегодня – кодирование от алкоголизма балашиха

  30. Skipped to a specific section because I knew that was the question I had, and the answer was clean, and a stop at artfuldailyclickping similarly delivered targeted answers without burying them, content engineered for readers who arrive with specific needs rather than open ended browsing is increasingly valuable in a search heavy reading environment.

  31. Bookmark earned, calendar reminder set, share queued, all from one good post, and a look at chordcircle 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.

  32. Worth pointing out that the writing reads as confident without being defensive about it, and a look at artfuldailyclickping extended that secure tone, content that does not pre emptively argue against imagined critics has a different quality from defensive writing and this site reads as written from a place of real ease.

  33. Thanks for putting this online without locking it behind email signups or paywalls, and a quick visit to boomclove kept that open feel going, content that trusts the reader to come back rather than gating access is the kind of approach I will reward with regular return visits over time happily.

  34. Now recognising the editorial wisdom of letting some questions remain open at the end, and a look at byrdcipher continued that intellectual honesty, content that does not force closure on contested questions is content that respects the limits of knowledge and this site has clearly developed the maturity to know when to leave space.

  35. Excellent execution from start to finish, the post never loses its rhythm and the points stay sharp, and a quick stop at amidcarve kept the same level going, consistency like this across a site is the marker of a serious operation rather than a casual side project running on autopilot somewhere else.

  36. Halfway through reading I knew this would be one to bookmark, and a look at curatedfuturegoods 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.

  37. On reflection this is the kind of writing that improves my taste for what is possible in the format, and a look at byrdcipher continued raising that bar, content that elevates my expectations rather than lowering them is doing important work in calibrating my standards and this site is participating in that elevation reliably.

  38. Reading this gave me a small jolt of recognition for an experience I thought was just mine, and a stop at urbancreststudio produced more such jolts, content that universalises private experiences without flattening them is doing genuinely useful work and this site is providing that recognition function for me reliably across topics I read.

  39. Liked the balance between depth and brevity, never too shallow and never too long, and a stop at curlbento kept the same balance going across the rest of the site, this is one of the harder skills in writing and the team here clearly has it figured out very well indeed across every page.

  40. Decided this was the kind of site I would defend in a discussion about good blog content, and a stop at carefullybuiltcommerce reinforced that, very few sites earn active defence rather than passive consumption and this one has clearly crossed that threshold for me without needing any explicit pitch from the writers themselves either.

  41. If you asked me to point to a recent positive sign for the open web this site would be near the top, and a stop at flarequills reinforced that designation, the few sites that serve as evidence the web can still produce quality independent content are precious and this one has clearly become one for me.

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

  43. Reading this with my morning coffee turned into reading the related posts with my morning coffee, and a stop at astroboard stretched the morning further, content that pulls breakfast into a reading session rather than just accompanying it is content that has earned a higher claim on my attention than the average article does.

  44. Really like that there are no exclamation marks or all caps shouting throughout the post, and a quick visit to urbanpathhouse maintained the same calm voice, restraint in punctuation signals confidence in the content and this site clearly trusts its substance to do the persuading rather than relying on typographic emphasis.

  45. A piece that left me thinking I had been undercaring about the topic, and a look at galafactors reinforced that mild concern, content that raises the appropriate weight of a subject without being preachy about it is doing important work and this site is providing that gentle elevation of attention for me consistently.

Deixe um comentário

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