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

  1. A piece that did not lean on the writer credentials or institutional backing, and a look at deoblob maintained the same focus on substance, content that earns trust through quality rather than through name dropping is the kind I find most persuasive and this site is clearly playing on the substance side of that distinction.

  2. Now planning a longer reading session for the archives, and a stop at vaultscript confirmed the archives are worth that longer commitment, sites with archives I want to read deliberately rather than just sample are rare and this one has clearly earned that level of interest based on the consistency of what I have already read.

  3. Felt this in a way I cannot quite explain, the topic just hit different here, and a stop at discoveropportunityflows continued in that vein, sometimes you find a site whose perspective lines up with how you have been thinking and reading their work feels like a small relief which I appreciated more than I expected.

  4. A piece that did exactly what it promised in the headline without overshooting or underdelivering, and a look at buildsmarthabits 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.

  5. Glad I gave this a chance rather than scrolling past, and a stop at bexedge confirmed I made the right call, sometimes the best content is hidden behind unassuming headlines that do not scream for attention and learning to slow down and check those out has paid off many times now across years of reading.

  6. Walked away in a slightly better mood than when I started reading, that says something about the writing, and a stop at startfreshthinking kept that going, content that leaves you feeling more capable rather than overwhelmed is the kind I keep coming back to again and again over the years and across many topics.

  7. Thanks for treating the topic with the seriousness it deserves without becoming pompous about it, and a stop at findgrowthchannels continued that balanced treatment, the gap between earnest and self serious is huge and writers who can stay on the right side of it earn my respect when I find them online today.

  8. Closed the laptop and walked away thinking about the post for a good twenty minutes, and a stop at swampstaple produced similar lingering thoughts, content that survives the closing of the browser tab is content that has actually entered the mind rather than just decorating the screen for the duration of the reading.

  9. Bookmarking this for later, the kind of resource I want to keep nearby, and a quick look at createimpactfulchange confirmed the rest of the site is worth the same treatment, definitely going into my reference folder for the next time the topic comes up at work or in conversation with someone who asks.

  10. Davidlepsy Davidlepsy

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

  11. A piece that handled the topic with appropriate weight without becoming portentous, and a look at buildpositiveprogress continued that calibrated seriousness, content that takes itself seriously without becoming pompous is something this site has clearly figured out and the balance shows up in every piece I have read across multiple sessions now.

  12. Closed the tab feeling I had spent the time well, and a stop at jadkix extended that feeling across more pages, the test of whether time on a site was well spent is one I apply silently after closing tabs and very few sites pass it but this one passed it cleanly today afternoon clearly.

  13. Bookmarking this for later, the kind of resource I want to keep nearby, and a quick look at discovernewpossibility confirmed the rest of the site is worth the same treatment, definitely going into my reference folder for the next time the topic comes up at work or in conversation with someone who asks.

  14. Reading this post made me realise I had been settling for lower quality elsewhere, and a look at derbunch extended that recalibration, content that exposes how much I had been accepting in adjacent sources is content with calibrating effect on my standards and this site is performing that calibration function across topics for me reliably.

  15. Time spent here today felt productive in the way that good reading sessions sometimes do, and a stop at startpurposefulgrowth extended that productive feeling across the rest of the morning, the difference between productive reading and merely passing time is real and this site is consistently on the productive side for me lately.

  16. Skipped the comments section but might come back to read it, and a stop at biablur hinted at a quality reader community, sites where the comments are worth reading separately from the post are increasingly rare and signal a particular kind of audience that has grown around the editorial vision over time gradually.

  17. Approaching this with the usual skepticism I bring to new sites and being slowly persuaded, and a stop at explorefreshconcepts continued that gradual persuasion, the careful path from skeptical reader to genuine fan is the only one I trust and this site has walked me along that path through patient consistent quality across pieces.

  18. Now thinking the topic is more interesting than I had given it credit for, and a stop at learnandadvanceforward continued that elevated interest, content that revives my curiosity about subjects I had set aside is doing genuine work in the structure of my interests and this site is providing that revivifying effect today actually.

  19. Quiet confidence runs through the whole post, no need to shout to make the points stick, and a stop at exploreideasfreely carried that same restrained voice forward, content that respects the reader by trusting its own substance rather than dressing it up in theatrical language is what I look for online and rarely actually find these days.

  20. Honestly enjoyed not being sold anything for the entire duration of the post, and a look at discovernewpossibility kept that pleasant absence going across more pages, content that exists for its own sake rather than as a funnel to a paid product is increasingly rare and worth supporting where I can find it.

  21. Closed it feeling slightly more competent in the topic than I started, and a stop at derbunch reinforced that competence boost, real learning is rare in casual online reading but it does happen sometimes and this site managed to make it happen for me today which is genuinely worth pausing to acknowledge.

  22. Appreciate the practical examples, they made the abstract points easier to grasp, and a stop at growwithfocusedaction added more of the same, this site clearly understands that real examples beat empty theory every single time which is the mark of a writer who knows their audience well and respects their time.

  23. Just sat with this for a bit longer than I usually would because the points are worth thinking about, and after designfocusedcommerce I had even more to chew on, the kind of post that nudges your thinking forward without forcing the issue is something I have always appreciated in good writing online.

  24. Skipped lunch to finish reading, which says something, and a stop at senatetrench kept me at my desk longer than planned, when content beats the lunch impulse the writer has done something genuinely impressive in an attention environment full of immediately satisfying alternatives competing for the same finite block of reader time.

  25. Appreciate the practical examples, they made the abstract points easier to grasp, and a stop at biablur added more of the same, this site clearly understands that real examples beat empty theory every single time which is the mark of a writer who knows their audience well and respects their time.

  26. Really appreciate this kind of writing, no shouting and no clickbait headlines just steady useful content, and a quick look at ilanub kept that going, definitely a site I will be returning to whenever I need a sensible take on similar topics in the days ahead and also during slower work weeks.

  27. Useful enough to recommend to several people I know who would appreciate it, and a stop at createvaluefast added more material I will pass along too, the kind of writing that earns word of mouth is the kind that actually delivers on its promises which is what this site does without any drama or fanfare attached.

  28. KevinBrulp KevinBrulp

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

  29. Reading this in a quiet coffee shop matched the calm energy of the writing, and a stop at jadyam extended that environmental match, content that has its own ambient quality which can match or clash with surroundings is content with a personality and this site has the kind of personality that suits calm reading.

  30. Worth flagging this post as worth a careful read rather than a casual skim, and a stop at buildstrategicfocus earned the same careful approach, the few sites that warrant slower reading are sites I now treat differently from the daily content stream and this one has clearly moved into that elevated treatment category.

  31. A piece that ended with a clean landing rather than fading out, and a look at jadyam maintained the same crisp conclusions, endings that resolve rather than dissolve are a sign of careful structural thinking and this site has clearly invested in how its pieces conclude rather than letting them simply run out of energy.

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

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

  34. Came across this and immediately thought of a friend who would enjoy it, and a stop at explorenewdirections also reminded me of someone, content that triggers the urge to share is content that has earned my recommendation and this site has earned multiple from me already across different conversations during the week.

  35. Reading this on a phone at a coffee shop and finding it perfectly suited to that context, and a stop at learnandgrowfaster continued the comfortable mobile experience, content that works across reading conditions without compromising on substance is increasingly important and this site has clearly thought about the whole reader experience here.

  36. Reading this gave me a small jolt of recognition for an experience I thought was just mine, and a stop at ilavex 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.

  37. In the middle of an otherwise scattered day this post landed as a moment of focus, and a stop at startstrongprogress extended that focused feeling across more pages, content that anchors a fragmented day rather than contributing to the fragmentation is content with real centring effect and this site is providing that anchoring function for me.

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

  39. Now considering writing a longer note about the post somewhere, and a look at buildstrategicfocus added more material for that note, content that prompts me to write rather than just consume is content with generative energy and this site is producing that generative effect for me at a higher rate than most sources.

  40. Reading this prompted a small redirection in something I was working on, and a stop at jifedge extended that redirecting influence, content that affects my actual work rather than just my thinking has the highest practical impact and this site is providing that level of influence for me at a sustainable rate apparently.

  41. Reading this prompted me to dig into a related topic later, and a stop at growstepbystep provided some of the starting points for that follow up reading, content that triggers further exploration rather than satisfying curiosity completely is content with real generative energy and this site has plenty of that energy throughout it.

  42. Rogerdrelo Rogerdrelo

    В этой статье мы рассматриваем разрушительное влияние зависимости на жизнь человека. Обсуждаются аспекты, такие как здоровье, отношения и профессиональные достижения. Читатели узнают о необходимости обращения за помощью и о путях к восстановлению.
    См. подробности – вывод из запоя стоимость

  43. A clear cut above the usual noise on the subject, and a look at findbettergrowthmodels only made that gap wider in my view, the kind of place that earns its visitors through quality rather than through aggressive marketing or sponsored placements which is increasingly the only way most sites stay afloat across the modern web.

  44. Really nice to see things explained without overcomplicating the topic, the words flow naturally and stay easy to follow, and a short visit to jalaxis only added to that experience because the same simple approach is used across the rest of the page too without any change in tone.

  45. More substantial than most of what I find searching for this topic online, and a stop at jifedge kept that quality consistent, this is one of those sites where the writing actually rewards careful reading rather than punishing the patient reader with empty filler stretched out across long paragraphs that say very little.

  46. KevinBrulp KevinBrulp

    В данной статье рассматриваются физиологические и эмоциональные аспекты зависимости. Мы обсудим, как организм реагирует на зависимое поведение, и какие методы помогают восстановить здоровье и внутреннее равновесие.
    Личный опыт — читайте сами – вывод из запоя на дому в самаре

  47. Skipped the related links section thinking I had read enough and then came back to it later when curiosity got the better of me, and a stop at unlockcreativeideas confirmed I should have just read it first, every section of this site appears to deserve careful attention rather than skipping past lazily.

Deixe um comentário

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