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

  1. Genuine reaction is that this site clicked with how I like to read, and a look at shopwithstyle kept that comfortable fit going, sometimes you find a place online whose editorial decisions just align with your preferences and when that happens it is worth recognising and supporting through repeat engagement consistently going forward.

  2. Reading this slowly and letting each paragraph land before moving on, and a stop at everydayfindsmarket earned the same patient approach, content that rewards slow reading rather than speed is content with real density and the writers here are clearly producing work that benefits from the careful eye rather than the rushed scan.

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

  4. Bookmark earned and the bookmark feels like a permanent addition rather than a maybe, and a look at fashiondailydeals confirmed that permanent status, the difference between durable bookmarks and ephemeral ones is something I have learned to feel quickly and this site triggered the durable feeling almost immediately during my first read here.

  5. Closed several other tabs to focus on this one as I read, and a stop at dailyshoppingzone held my undivided attention the same way, content that earns full focus in an attention environment full of competing pulls is content doing something genuinely well and the team behind it deserves recognition for that achievement consistently.

  6. Reading this in the gap between work projects was a small but meaningful break, and a stop at findyourowngrowth extended that gentle reset, content that provides genuine refreshment rather than just distraction during work breaks is content with a particular kind of utility and this site fits that role for me reliably during work days.

  7. Generally I find the content on similar topics frustrating in specific ways and this post avoided all of them, and a look at urbanfashioncorner continued that frustration free experience, content that sidesteps the standard failure modes of its genre is content with editorial awareness and this site has clearly studied what fails elsewhere consistently.

  8. Genuine reaction is that this site clicked with how I like to read, and a look at keepmovingforward kept that comfortable fit going, sometimes you find a place online whose editorial decisions just align with your preferences and when that happens it is worth recognising and supporting through repeat engagement consistently going forward.

  9. Decided I would read the archives over the weekend, and a stop at modernstylemarket confirmed that the archives would be worth the time, very few sites have archives I would actively read through but this one has earned that level of interest based on the consistent quality across what I have sampled so far.

  10. This site definitely has all the information and facts I wanted concerning this subject and
    didn’t know who to ask.

  11. 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 dailytrendmarket showed the same care for the reader which is something I will remember the next time I need answers on a topic.

  12. Picked this post to share in a Slack channel where I knew it would be appreciated, and a look at discoverhomeessentials suggested I will share more from here later, content worth sharing into a professional context is content that has earned a higher kind of trust than mere personal interest and this site has it.

  13. Working through this site has been a small antidote to the shallow content that fills most of my reading time, and a stop at starttodaymoveforward extended that antidote function, sites that quietly improve the average quality of my reading by being themselves are sites worth supporting through return visits and recommendations consistently.

  14. Good clean post, no errors and no awkward phrasing that breaks the reading flow, and a stop at simplebuyhub 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.

  15. Reading this gave me a quiet moment of intellectual pleasure that I had not been expecting, and a stop at everydayfindsmarket extended that pleasure across more pages, the unexpected reward of stumbling into careful writing is one of the small ongoing pleasures of reading the open web and this site is delivering it reliably.

  16. Reading this gave me a small framework I expect to use going forward, and a stop at makeimpacteveryday extended that framework, content that produces transferable mental models rather than just specific facts is content with multiplicative value and this site is providing those models at a rate that justifies extra attention from me regularly.

  17. Reading this on a long flight and finding it the best thing I read across hours of trying, and a stop at makeimpacteveryday kept the streak going, when content beats long flight reading you know it has substance because flight reading is a hard test of a piece given the alternatives available everywhere.

  18. A piece that exhibited the kind of patience that good writing requires, and a look at believeinyourideas continued that patient quality, hurried writing is easy to spot and this site reads as having been written without time pressure which produces a different feel than the rushed content that dominates much of the modern blog space.

  19. If I had to summarise the editorial sensibility of this site in a few words it would be careful and human, and a look at uniquevaluecorner extended that summary feeling, capturing the essence of a sites approach in brief is hard but this site has a clear enough identity that the summary comes naturally enough.

  20. Reading this in my last reading slot of the day was a good way to end, and a stop at discoverandbuy 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.

  21. Reading this prompted me to dig into a related topic later, and a stop at shapeyourdreams 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.

  22. Speaking from the perspective of having read widely on the topic this site offers something distinct, and a look at findyourinspirationtoday reinforced that distinctness, the rare site that contributes something genuinely original to a saturated topic is the rare site worth following carefully and this one has demonstrated that original contribution capability today.

  23. Reading this confirmed something I had been suspecting about the topic, and a look at globalfashionfinds 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.

  24. Now feeling the small relief of finding writing that does not condescend, and a stop at simplebuyhub 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.

  25. Excellent post, balanced and well organised without showing off, and a stop at changeyourfuture continued in that same vein, this site has clearly figured out the formula for content that works for readers rather than for search engine ranking signals which is harder than it sounds today and worth real recognition from anyone.

  26. A genuine compliment to the writer for keeping the post focused on what mattered, and a look at everydaystylemarket 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.

  27. A thoughtful read in a week that has been mostly noisy, and a look at trendycollectionhub carried that thoughtful quality across more pages, finding pockets of considered writing in a week of distractions is one of the small wins of careful curation and this site is providing those pockets at a sustainable rate.

  28. Now saved this in a way that I will actually find again rather than the casual bookmark approach, and a stop at brightvalueworld earned the same careful saving, organising my reading bookmarks so that high quality sources rise to the top is something I should do more of and this site triggered that organisation today.

  29. Now recognising that this site has earned a place in the small group of resources I treat as authoritative, and a stop at brightnewbeginnings confirmed that placement, the difference between resources I trust and resources I just consume is real and this site has clearly moved into the trusted category through consistent quality over time.

  30. Considered as a whole this site has developed a coherent point of view that comes through in individual pieces, and a look at yourvisionawaits continued displaying that coherence, sites with a unified perspective rather than a grab bag of takes are sites with editorial maturity and this one has clearly developed that maturity through years of work.

  31. Came in for one specific question and got answers to three I had not even thought to ask, and a look at learnandimprove 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.

  32. Probably one of the more reliable sources I have found for this kind of careful coverage, and a look at nexshelf 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.

  33. MichaelPen MichaelPen

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

  34. Appreciate the practical examples, they made the abstract points easier to grasp, and a stop at dreamcreateachieve 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.

  35. Came across this looking for something else entirely and ended up reading it through twice, and a look at groweverymoment pulled me deeper into the site than I planned, the writing has a way of holding attention without resorting to manipulative cliffhangers or vague promises that never get delivered later down the page.

  36. Worth recognising the specific care that went into how this post ended, and a look at findpeaceandpurpose maintained the same careful conclusions, endings are where most blog content falls apart and this site has clearly invested in the closing stretches of its pieces rather than letting them simply trail off when energy fades.

  37. Quality work here, the post reads cleanly and the points stay focused throughout, and a stop at findpeaceandpurpose kept the standard high, you can tell the writer cares about the final result rather than just hitting publish for the sake of having something new on the page to feed the search engines.

  38. A piece that read as if the writer was thinking carefully rather than just typing fluently, and a look at discoverpossibility continued that considered quality, the difference between fluent typing and careful thinking shows up in writing and this site reads as the product of thought rather than just the product of language fluency apparently.

  39. Thanks for keeping the writing direct without losing the warmth that makes content feel human, and a stop at modernhometrends carried both qualities forward, balancing professionalism and personality is a rare skill and the writers here have clearly figured out how to consistently land it across many posts which I notice.

  40. Thank you for keeping the writing honest and the points easy to verify against your own experience, and a stop at stayfocusedandgrow reflected the same approach, no exaggeration just steady useful content that I can take with me into my own work without second guessing every sentence I happen to read here.

  41. Substantially, the post is really the best on this laudable topic. I concur with your conclusions and will eagerly watch forward to your future updates.Just saying thanx will not just be enough, for the wonderful lucidity in your writing.

  42. Reading this in the gap between work projects was a small but meaningful break, and a stop at ranknexus extended that gentle reset, content that provides genuine refreshment rather than just distraction during work breaks is content with a particular kind of utility and this site fits that role for me reliably during work days.

  43. Recommended without hesitation if you care about careful coverage of this topic, and a stop at nexshelf reinforced the recommendation, the bar I set for unhesitating recommendations is fairly high and this site has cleared it through the cumulative weight of multiple consistently good pieces rather than through any single standout post which is meaningful.

  44. MatthewBox MatthewBox

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

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

  46. Genuine reaction is that this site clicked with how I like to read, and a look at dailytrendmarket kept that comfortable fit going, sometimes you find a place online whose editorial decisions just align with your preferences and when that happens it is worth recognising and supporting through repeat engagement consistently going forward.

  47. Appreciated how the post felt complete without overstaying its welcome, and a stop at makesomethingnew 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.

Deixe um comentário

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