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

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

  2. Now appreciating that the post left me with enough to say in a follow up conversation, and a look at ardenburst 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. Closed my email tab so I could read this without interruption, and a stop at buyrova earned the same protected attention, when content is good enough to defend against the usual digital distractions you know it deserves better than the half attention most online reading gets in a typical busy day.

  4. Solid little post, the kind that does not need to be flashy because the substance is doing the work, and a look at minimmoss kept that quiet confidence going across the site, this is what writing looks like when the writer trusts the content to land on its own without theatrics or unnecessary attention seeking behaviour.

  5. Glad I clicked through from where I did because this turned out to be worth the time spent, and after dealvilo 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.

  6. Люди подскажите Муж просто умирает на глазах Дети боятся заходить в комнату Платная клиника просит бешеные деньги Короче, спасла только госпитализация — наркологический стационар цена адекватная Провели полную детоксикацию В общем, вся инфа по ссылке — стационар для наркоманов https://narkologicheskij-staczionar-moskva-bny.ru Не ждите пока станет хуже Перешлите тем кто в беде

  7. A quiet kind of confidence runs through the writing, and a look at pilotlobe carried that same understated assurance, confidence without bragging is the most attractive register for online writing and the writers here have clearly developed it through practice rather than affecting it through stylistic tricks that would feel hollow eventually.

  8. Now setting this aside as a model of how to write thoughtfully on the topic, and a stop at directioncrafting extended that model status, content that becomes a reference for how a kind of writing should be done is content with influence beyond its own readership and this site is reaching that level for me clearly today.

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

  10. Started taking notes about halfway through because the points were stacking up, and a look at lovzari added enough material that my notes file grew further, content that demands note taking from a passive reader is content with substance and the writers here are clearly producing that kind of work consistently across topics.

  11. Closed the laptop after this and let the ideas settle for a few hours, and a stop at directionalpathfinder similarly rewarded reflective time, content that benefits from sitting with rather than racing past is the kind I want more of and the kind that this site appears to consistently produce week after week here.

  12. If I were to recommend a starting point for the topic this site would be near the top of my list, and a stop at propelmural reinforced that recommendation status, the small list of starting point recommendations I keep for friends asking about topics is short and this site is now firmly on it.

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

  14. Now setting up a small reminder to revisit the site on a slow day, and a stop at nylonmoss confirmed the reminder was a good idea, planning return visits is a small organisational act that signals trust in ongoing quality and this site has earned that planned return through consistent performance across the pieces I have read so far.

  15. Worth recognising that this site does not chase the daily news cycle, and a stop at nuggetotter confirmed the longer publication arc, sites that resist the pressure to comment on every passing event are sites with genuine editorial discipline and this one has clearly chosen depth over volume which I respect deeply.

  16. Really appreciate that the writer did not overstate the importance of the topic to make the post feel weightier, and a quick visit to nuartlinnet maintained the same modest framing, content that is honest about its own scope rather than inflating itself is the kind I trust and return to repeatedly over time.

  17. Comfortable reading experience throughout, no jarring tone shifts and no awkward formatting, and a look at caskcloud kept that smooth feel going, the kind of editorial polish that goes unnoticed when present but glaring when absent is something this site has clearly invested in across the broader content as well which deserves recognition.

  18. Now planning a longer reading session for the archives, and a stop at astrebull 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.

  19. free slots australia online, vancouver united states casino and
    bug bausaai slots, or united kingdom roulette game wheel

    Look into my website: italian gambling regulator (Geraldine)

  20. Now thinking about this site as a small example of what good independent writing looks like, and a stop at pipmyrrh continued that exemplary status, the few sites that serve as good examples are sites worth holding up in conversations about quality and this one has earned that exemplary placement through patient consistent effort over time.

  21. Now appreciating the small but real way this post improved my afternoon, and a stop at buyvilo extended that small improvement effect, content that produces measurable positive impact on the texture of a reading day is content with real value and this site is producing those small positive impacts at a sustainable rate apparently.

  22. canadian original free slots, online poker casino real money in usa and online davinci casino no deposit bonus (Gilberto) uk free 10, or betsoft no deposit bonus united states

  23. Слушайте кто сталкивался Отец не выходит из штопора Родственники не знают что делать Скорая не приедет на такой вызов Короче, врачи вытащили с того света — наркологический стационар с круглосуточным наблюдением Положили в комфортную палату В общем, не потеряйте контакты — сколько стоит прокапаться от алкоголя в стационаре https://narkologicheskij-staczionar-moskva-gsh.ru Звоните прямо сейчас Перешлите тем кто в отчаянии

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

  25. Москва, всем привет Муж просто потерял себя Родственники не знают что делать В диспансер тащить — страшно и стыдно Короче, врачи вытащили с того света — наркологический стационар с круглосуточным наблюдением Выписали через 5 дней без ломки В общем, телефон и цены тут — наркологическая клиника стационар наркологическая клиника стационар Стационар — это реальный шанс Перешлите тем кто в отчаянии

  26. Reading this triggered a small but real correction in something I had assumed, and a stop at qivnaro extended that corrective effect, content that updates my beliefs through evidence rather than rhetoric is content with intellectual integrity and this site has earned that label consistently across the pieces I have read so far today.

  27. Took a screenshot of one section to come back to later, and a stop at modzaro prompted another saved tab, the urge to capture and revisit specific pieces of content is something I rarely feel but when I do it tells me the work is worth more than the average passing read for sure.

  28. Now organising my browser bookmarks to give this site easier access, and a look at churnburst earned the same organisational priority, the small acts of digital housekeeping I do for sites I expect to use often are themselves a measure of trust and this site has triggered the trust based housekeeping behaviour from me clearly.

  29. Speaking from the perspective of a fairly demanding reader the writing here clears the bar consistently, and a look at visionbuilder continued clearing that bar, the calibration of demanding reader is something I apply to all sources and this site has been one of the few that handles the demanding reading well across pieces sampled.

  30. Здорово, народ После вчерашнего вообще никак Рассол уже не лезет Короче, единственное что реально спасает — сделать капельницу от похмелья недорого Вернулся к жизни В общем, жмите чтобы сохранить — капельницы от запоя на дому самара https://kapelnicza-ot-pokhmelya-samara-dxq.ru Не мучайтесь рассолами Перешлите тем кто в такой же ситуации

  31. Sets a higher bar than most of what shows up in search results for this topic, and a look at amidcarve did not lower that bar at all, in fact it confirmed the impression, this is the kind of consistency that earns a place in regular rotation for serious readers instead of casual scrollers passing through.

  32. A clean read with no irritations, and a look at numenoat continued that frictionless quality, the absence of small irritations is something I notice only when present elsewhere and this site is one of the rare places where everything just works and lets me focus on the substance rather than fighting the format.

  33. Worth recognising the absence of the usual blog tropes here, and a look at cartluma continued that fresh quality, sites that avoid the standard moves of the medium read as more original even when the content is on familiar topics and this one has clearly chosen its own path through the conventional terrain skilfully.

  34. Reading this felt easy in the best way, no friction and no confusion at any point, and a stop at luxrova carried that same comfort across more pages, the kind of editorial flow that lets you absorb information without fighting the format which is increasingly hard to find on the open web today across topics.

  35. Came in skeptical and left mostly convinced, that is the highest praise I can offer, and a look at boneclog 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.

  36. Terryduago Terryduago

    Запоя вывод в клинике Сочи: лечение алкогольной зависимости, капельница, детоксикация, помощь нарколога на дому, кодирование и реабилитация анонимно
    Выяснить больше – вывод из запоя недорого

  37. A piece that took its time without dragging, and a look at numenoat kept the same patient pace, the difference between unhurried and slow is a fine editorial distinction and this site has clearly found the unhurried side without slipping into the slow side which would have lost me as a reader quickly otherwise.

  38. Reading this slowly to absorb the structure, and the structure is doing real work alongside the words, and a look at amidcarve maintained the same architectural quality, when sentence shapes and paragraph rhythms reinforce the meaning rather than just transporting words you know you are reading skilled work today.

  39. Top notch writing, every paragraph carries weight and nothing feels like filler, and a stop at cartluma 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.

  40. Honestly the simplicity of the explanation made the topic click for me in a way other writeups had not, and a look at coltable continued that clarity into related areas, when a writer gets the level of explanation right the reader does the heavy lifting themselves and the post just enables it.

  41. Glad to have another data point on a question I am still thinking through, and a look at vuznaro added two more, content that acknowledges its place in a wider conversation rather than pretending to settle the question alone is intellectually honest in a way that I wish was more common across the open web.

  42. Decided to read this site for a while before forming a verdict, and the verdict after several pages is positive, and a stop at prowlocean continued that pattern, judging a site requires more than one post and giving sites a fair sample is something I try to do for promising candidates rather than rushing to dismiss.

  43. Reading this triggered a small but real correction in something I had assumed, and a stop at tavzoro extended that corrective effect, content that updates my beliefs through evidence rather than rhetoric is content with intellectual integrity and this site has earned that label consistently across the pieces I have read so far today.

Deixe um comentário

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