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.

10.042 Comentários

  1. Decided not to skim despite my usual habit and was rewarded for the discipline, and a stop at octanenebula 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.

  2. Now appreciating that the post left me with enough to say in a follow up conversation, and a look at vuzmixo added more material for those follow ups, content that prepares me for related conversations rather than just informing me alone is content with social utility and this site provides that social armament reliably for me.

  3. Just wanted to drop a quick note saying this was a useful read on a topic I have been circling, no fluff, and a stop at arialcamp added a few extra points that fit the same simple style which makes the whole site feel coherent rather than thrown together by many different writers with different goals.

  4. Without overstating it this is a quietly excellent post, and a look at zorlumo 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.

  5. Now leaving a small mental note to recommend this when the topic comes up in conversation, and a look at boneclog extended that recommend ready feeling, content that arms me with shareable references for likely future conversations is content with social value and this site is providing that conversational ammunition consistently for me lately.

  6. Liked that there was nothing performative about the writing, and a stop at molnexo continued that genuine quality, performative writing tries to be witnessed rather than read and the difference between performance and substance is huge for the careful reader and this site has clearly chosen substance every time clearly.

  7. Really liked the calm tone running through the post, no shouting and no urgency forced into the writing, and a look at intentionalmomentum kept that quiet confidence going, the kind of voice that makes the reader feel respected rather than yelled at which is depressingly common across most modern blog content these days.

  8. Bookmark earned, share earned, return visit earned, all from one reading session, and a look at vuznaro did the same, the trifecta of bookmark and share and return is rare in a single visit and represents the highest level of engagement I tend to offer any piece of online content these days here.

  9. Picked a single sentence from this post to remember, and a look at pippierce 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.

  10. Люди помогите советом Близкий человек уже неделю в запое Родственники не знают что делать В диспансер тащить — страшно и стыдно Короче, врачи вытащили с того света — наркологический стационар с круглосуточным наблюдением Врачи наблюдали 24/7 В общем, не потеряйте контакты — наркология москва стационар https://narkologicheskij-staczionar-moskva-vex.ru Стационар — это реальный шанс Это может спасти чью-то семью

  11. The way the post stayed on topic throughout without going on tangents was really refreshing, and a look at tavzoro kept that focused approach going, discipline like this in writing is rare and worth recognising because most writers cannot resist wandering off into related subjects that dilute their main point and confuse readers along the way.

  12. Most blog writing on this subject reaches for the same handful of arguments and this post avoided them, and a look at visionalignment continued the original treatment, content that finds its own path through territory other writers have flattened is content with real authorial energy and this site has plenty of that distinctive energy.

  13. Beats most of the alternatives on the topic by a noticeable margin, and a look at milknorth 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.

  14. Came in expecting another generic take and got something with actual character instead, and a look at luxrivo 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.

  15. Useful information presented in a way that does not feel like a sales pitch, that is what I appreciated most, and a stop at molnexo was the same, no upsell and no fake urgency just steady content laid out properly for someone trying to actually learn from it rather than just be sold to.

  16. Слушайте кто сталкивался Брат снова сорвался в пьянку Дети напуганы до смерти Платная клиника — бешеные деньги Короче, только стационар реально помог — госпитализация в наркологический стационар 24/7 Выписали через 5 дней без ломки В общем, вся инфа по ссылке — палата в наркологии https://narkologicheskij-staczionar-moskva-vex.ru Стационар — это реальный шанс Перешлите тем кто в отчаянии

  17. Слушайте кто сталкивался Беда пришла в семью Родственники не знают что делать В диспансер тащить — страшно и стыдно Короче, врачи вытащили с того света — наркологическая больница стационар с капельницами Врачи наблюдали 24/7 В общем, не потеряйте контакты — лечение алкоголизма стационар цены https://narkologicheskij-staczionar-moskva-vex.ru Стационар — это реальный шанс Перешлите тем кто в отчаянии

  18. Picked a single sentence from this post to remember, and a look at pippierce 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.

  19. Skimmed first and then went back to read carefully, and the careful read paid off in places I had missed, and a stop at cabinbull got the same treatment, the rare site whose content rewards a second pass is content I want more of in my regular rotation rather than disposable single read articles.

  20. However many similar pages I have read this one taught me something new, and a stop at palettemauve added more new material, content that contributes genuinely fresh information rather than recycling what is already widely available is content with real informational value and this site is providing that informational freshness at a notable rate.

  21. Felt mildly happier after reading, which sounds silly but is true, and a look at xarmizo extended that small mood lift, content that improves rather than degrades my mental state is content I want more of and the cumulative effect of reading sites that lift versus sites that drag is real over time.

  22. Nice and clean, that is the best way to describe the writing here, no clutter and no wasted words, and a quick visit to upperspruce kept that going, I appreciate when a site treats its readers like people who can think for themselves without needing constant hand holding through every paragraph.

  23. I really like how the writer keeps the tone friendly without sounding fake or overly polished, and after a stop at torqavi the same calm pace was there, no rushing to make a point and no padding either, just clean honest writing that I can respect and come back to later again.

  24. Thanks for the honest framing without exaggerated claims that the topic will change my life, and a stop at qorlino kept the same modest tone, restraint in marketing language signals trustworthiness and the writers here are clearly playing the long game by building credibility rather than chasing immediate clicks through hyperbole.

  25. This one is staying open in a tab for the rest of the day so I can come back and re read certain parts, and a look at zorvilo suggests I will be doing the same with a few more pages here too, this is going to be a deep dive over the coming hours.

  26. Found this useful, the points line up well with what I have been thinking about lately, and a stop at mastlarch added some angles I had not considered yet, definitely walking away with more than I came for which is the best outcome from time spent reading online for any kind of topic.

  27. Reading the writers other posts after this one suggests the quality is consistent rather than peak, and a stop at pebbleoboe confirmed the consistent quality reading, sites that hold the same level across many pieces rather than peaking on a few are sites with sustainable editorial discipline and this one has clearly developed that.

  28. Now feeling the quiet pleasure of finding writing that takes itself seriously without being self serious, and a stop at xinvexa extended that subtle pleasure, the gap between earnest and pretentious is fine and this site has clearly chosen to land on the earnest side without slipping over into pretentious which is impressive.

  29. Really liked the calm tone running through the post, no shouting and no urgency forced into the writing, and a look at torqavi kept that quiet confidence going, the kind of voice that makes the reader feel respected rather than yelled at which is depressingly common across most modern blog content these days.

  30. If patience for careful reading is rare these days finding sites that reward it is rarer still, and a stop at ideastomotion 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.

  31. Better than most of the writing I have come across on this topic recently, simpler and more direct, and a look at zorvilo continued in that same way, a real outlier in a crowded space full of repetitive content that says little while taking up a lot of reader time today which is unfortunate.

  32. Glad I clicked through from where I did because this turned out to be worth the time spent, and after molvani I had a fuller picture, the kind of content that earns its visitors through delivering value rather than chasing them through aggressive advertising or constant pop ups appearing everywhere on the screen lately.

  33. Will be sharing this with a couple of people who care about the topic, and a stop at astrobrunch 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.

  34. This one is staying open in a tab for the rest of the day so I can come back and re read certain parts, and a look at mastlarch suggests I will be doing the same with a few more pages here too, this is going to be a deep dive over the coming hours.

  35. Слушайте кто знает Муж пьёт без остановки Соседи стучат в стену Скорая не приедет Короче, единственное что вытащило из запоя — капельница от запоя цена доступная Сняли ломку и стабилизировали состояние В общем, телефон и цены тут — капельница против похмелья капельница против похмелья Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  36. Now feeling the quiet pleasure of finding writing that takes itself seriously without being self serious, and a stop at zulvexa extended that subtle pleasure, the gap between earnest and pretentious is fine and this site has clearly chosen to land on the earnest side without slipping over into pretentious which is impressive.

  37. Reading this gave me confidence to make a decision I had been putting off, and a stop at pebbleoboe reinforced that confidence, content that translates into action in my own life rather than just informing it is content with the highest practical value and this site is generating that action level utility for me lately.

  38. The whole experience of reading this was pleasant from start to finish, no pop ups and no annoying interruptions, and a look at octanepinto continued that clean experience, technical choices about page design matter for the reader and this site clearly cares about the small details that add up to comfort across multiple visits.

  39. Bookmark folder reorganised slightly to make this site easier to find, and a look at minimparch earned the same accessibility upgrade, the small organisational moves I make for sites I expect to return to often are themselves a signal of how much I trust them and this site triggered those moves naturally.

  40. Good quality through and through, no rough edges and no signs of being rushed, and a quick look at ideastomotion kept the same polish going, the kind of site that respects its own brand by maintaining consistency across pages which is something I always appreciate as a reader looking for trustworthy information online today.

  41. Glad to find something on this topic that does not start with three paragraphs of throat clearing before getting to the point, and a stop at civiccask also dives right in, respect for the readers time shows up in small editorial choices like this and they add up to a real difference quickly.

  42. Now adding the homepage to my regular check rotation rather than waiting for individual links to find me, and a stop at cartrivo confirmed the rotation upgrade, the move from passive discovery to active checking is a vote of confidence in a sites ongoing quality and this site has earned that active engagement clearly.

Deixe um comentário

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