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

  1. Honest assessment is that this is one of the better short reads I have had this week, and a look at melqavo reinforced that, the bar for short content is low because most of it sacrifices substance for brevity but this site manages both at once which is harder than it sounds for most writers attempting it.

  2. Now recognising the specific pleasure of reading writing that shows real care for sentence shapes, and a look at modelmetro extended that craft pleasure, sentence level writing quality is something most blog content ignores entirely and this site has clearly invested in the prose layer alongside the substance which is rare today.

  3. Over the course of reading several posts here a pattern of quality has emerged, and a stop at neatglyphs confirmed the pattern, the difference between sites that hit quality occasionally and sites that hit it consistently is huge and this site has clearly demonstrated the consistent kind through what I have read this morning.

  4. Bookmark added with a small mental note that this is a site to keep, and a look at fumegrove reinforced the keep status, the verb keep rather than visit captures something about how I think about this kind of site and it is a higher tier of relationship than I have with most places online today.

  5. Picked a single sentence from this post to remember, and a look at fernpier gave me another to keep, content that produces memorable lines is doing more than just transferring information and the small selection of sentences I keep from each reading session is one of the actual returns I get from reading carefully.

  6. Came in tired from a long day and the writing held my attention anyway, and a stop at datacabin kept that going, content that can engage a fatigued reader is doing something right because most online reading happens in suboptimal conditions like that one and quality content adapts to it without complaint.

  7. WoodrowCraky WoodrowCraky

    В этой статье мы обсудим процесс восстановления после зависимостей, акцентируя внимание на различных методах и подходах к реабилитации. Читатели узнают, как создать план выздоровления и использовать полезные ресурсы для достижения устойчивых изменений.
    Прочесть заключение эксперта – podolsk detox24

  8. Glad the writer did not feel compelled to cover every possible angle of the topic, focus is a virtue, and a stop at mossmute reflected the same disciplined scope, knowing what to leave out is half of what makes good writing good and this post has clearly been edited with that principle in mind.

  9. Came in skeptical and left mostly convinced, that is the highest praise I can offer, and a look at lattepinto pushed me further in the same direction, content that survives a critical first read is rare and worth recognising because most blog posts crumble under any real scrutiny these days when you actually pay attention closely.

  10. One of the more honest takes on the topic I have seen lately, no spin and no oversell, and a stop at velzaro kept that going, the kind of voice the open web could use a lot more of rather than the endless echo chamber of recycled opinions floating around every social platform these days.

  11. Decided not to skim despite my usual habit and was rewarded for the discipline, and a stop at whimharbor earned the same patient approach, training myself to recognise sites that warrant slower reading is part of being a careful online reader and this site is the kind that helps me practice that skill regularly.

  12. Top notch writing, every paragraph carries weight and nothing feels like filler, and a stop at trendzaro reflected that same care, a rare thing on the open web these days where most pages exist for clicks rather than actual reader value or anything close to that which is honestly a real shame.

  13. Without comparing too aggressively to other sources this one stands out for the right reasons, and a look at briskolive continued that distinctive quality, content that distinguishes itself through substance rather than style tricks is content with lasting differentiation and this site has clearly chosen substance based differentiation as its core editorial strategy.

  14. Closed the laptop and walked away thinking about the post for a good twenty minutes, and a stop at plantmedal 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.

  15. If patience for careful reading is rare these days finding sites that reward it is rarer still, and a stop at elitefests extended that rare reward, the diminishing returns on shallow content reading have made me more selective about where to spend reading time and this site is meeting the higher selectivity bar consistently.

  16. Comfortable read, finished it without realising how much time had passed, and a look at firminlet pulled me into more pages the same way, the absence of friction in good content lets time disappear and that is one of the highest compliments I can pay any piece of writing I find online during a regular search session.

  17. The clarity here is something I really appreciate, especially compared to sites that pile on jargon for no reason, and a look at connectgrowachieve was the same, simple direct sentences that actually deliver information instead of dancing around the point for paragraphs at a time which wastes reader patience.

  18. CoreyTus CoreyTus

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

  19. Speaking honestly this is among the better discoveries of my recent browsing, and a stop at tavquro reinforced that discovery quality, the ranking of recent discoveries is informal but meaningful and this site has placed near the top of that ranking based on the consistency of quality across what I have already read carefully.

  20. Williamker Williamker

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

  21. Now wondering how the writers calibrated the level of detail so well, and a stop at dealbrawn continued the same calibration, the right level of detail is one of the harder editorial calls in any piece and this site has clearly developed an instinct for it through what I assume is years of careful practice publicly.

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

  23. Found the post genuinely useful for something I was working on this week, and a look at laurelleap 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.

  24. Just enjoyed the experience without needing to think about why, and a look at zorlumo kept that effortless feeling going, sometimes the best content is invisible in the sense that you forget you are reading until you reach the end and realise time has passed without you noticing it pass naturally.

  25. Reading this between two meetings turned out to be the highlight of the morning, and a stop at laurelleap continued that highlight quality, content that outshines the structured parts of a working day is doing something well beyond ordinary and this site has produced multiple such highlights for me already this week alone.

  26. Will be back, that is the simplest way to say it, and a quick visit to parcohm reinforced the decision, this site has earned a spot in my regular rotation alongside a few other reliable places I check when I want something genuinely informative without all the usual modern web noise getting in the way.

  27. Probably going to mention this site in a write up I am working on later this month, and a stop at quilllava provided more material for that potential mention, content worth referencing in my own published work rather than just personal reading is content with the highest endorsement level and this site has earned that endorsement.

  28. Now noticing that the post avoided the temptation to be funny in places where humour would have undermined the substance, and a stop at plasmapiano maintained the same restraint, knowing when to be serious is a rare editorial virtue and this site has clearly developed it through what I assume is careful editorial practice over years.

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

  30. Reading this slowly in the morning before opening email, and a stop at cadetarena extended that protected attention, content that earns the prime morning reading slot before the daily distractions begin is content with elevated status and this site has earned that prime slot consistently in my recent reading habits clearly.

  31. Jamelstemi Jamelstemi

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

  32. Came away feeling slightly smarter than I was when I started, that is a real win, and a stop at plasmapiano added a bit more to that, the rare site that actually transfers some of its knowledge to the reader in a way that sticks rather than just creating an illusion of learning briefly.

  33. Glad I gave this a chance rather than scrolling past, and a stop at urbanluma 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.

  34. Felt the writer did the homework before publishing, the references hold up, and a look at modvani continued that documented care, content with traceable claims rather than vague assertions is the kind I trust and the lack of bald assertion in this post is one of its quietly impressive qualities for me.

  35. StephenUttef StephenUttef

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

  36. Looking at the surface design and the substance together this site has both right, and a look at platenavy reinforced that integrated quality, sites where presentation and content reinforce each other rather than fighting are sites with full editorial coherence and this one has clearly invested in both layers in a balanced way.

  37. Took a chance on the headline and was rewarded, and a stop at probemound 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.

  38. Started reading without much expectation and ended on a high note, and a look at mallowmorel continued that arc, content that builds rather than peaks early is a sign of a writer who knows how to structure a piece for sustained reader engagement rather than relying on a strong hook to do all the work.

  39. Hello There. I found your weblog the use of msn. That is a very neatly written article.

    I’ll be sure to bookmark it and return to learn extra of your helpful information. Thank you for the post.
    I’ll certainly return.

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

  41. Really grateful for content like this, it does not waste my time and it does not insult my intelligence either, and a quick look at musebeats was the same, balanced respectful writing that makes a person feel welcome rather than rushed through pages of forced engagement just to keep clicking around.

  42. Reading this confirmed that my time researching the topic in other places had not been wasted, and a stop at flarefest extended the confirmation, when independent sources agree that is a useful signal and this site is one of the more reliable sources I have found for cross checking what I read elsewhere on similar subjects.

  43. ArthurTeake ArthurTeake

    Публикация знакомит читателей с различными подходами к реабилитации. От традиционных методов до современных программ — вы узнаете, как выбрать оптимальный путь к выздоровлению и преодолеть препятствия на этом пути.
    Продолжить чтение – rybinsk detox24

  44. Came in expecting another generic take and got something with actual character instead, and a look at tilvexa carried that personality forward, finding a distinct voice on a saturated topic is impressive and worth pointing out when it happens because most sites end up sounding identical to their nearest competitors quickly.

  45. A welcome contrast to the loud takes that have dominated my feed lately, and a look at plazaomega 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.

  46. Honest opinion is that this is the kind of post that builds long term trust with readers, and a look at clippoise 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.

  47. Will be coming back to this for sure, too much good content to absorb in one sitting, and a stop at plazaomega only added more pages I want to dig through, this site is going onto my regular rotation list because it consistently delivers something worth the visit lately rather than empty filler.

Deixe um comentário

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