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

  1. Closed the tab and immediately reopened it ten minutes later because I wanted to reread a part, and a stop at actionoptimizer drew the same return, content that pulls you back after closing it is doing something well beyond the average and worth marking as exceptional in my mental catalogue of reliable sites.

  2. Just sat with this for a bit longer than I usually would because the points are worth thinking about, and after conexbuilt 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.

  3. A quiet piece that did not try to compete on volume, and a look at peltpetal maintained that selective approach, sites that publish less but better are increasingly rare in an environment that rewards volume and this one has clearly chosen quality cadence over quantity which is a brave editorial decision in current conditions.

  4. Recommend this to anyone who values clear thinking over flashy presentation, and a stop at pacerlucid continued in the same understated way, this site has its priorities in the right place which makes it worth supporting through repeat visits and recommendations rather than just one passing read today before moving on quickly elsewhere.

  5. Reading this with my morning coffee turned into reading the related posts with my morning coffee, and a stop at cartzaro stretched the morning further, content that pulls breakfast into a reading session rather than just accompanying it is content that has earned a higher claim on my attention than the average article does.

  6. Honestly this was the highlight of my reading queue today, and a look at movlino extended that across more pages I will return to, ranking what I read against what else I read each day is something I do informally and this site keeps moving up in those rankings the more I explore it.

  7. Useful read, especially because the writer did not assume too much background from the reader, and a quick look at auralbrig continued in the same way, a thoughtful site that meets people where they are which is something the modern web could use a lot more of for both casual and serious readers.

  8. Bookmark earned, share earned, return visit earned, all from one reading session, and a look at urbanso 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. A well calibrated piece that knew its scope and stayed inside it, and a look at pivotllama maintained the same scope discipline, scope creep is one of the failure modes of long blog posts and this site has clearly invested in the editorial discipline to prevent it which shows up in tightly contained pieces.

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

  11. Reading this on a phone at a coffee shop and finding it perfectly suited to that context, and a stop at actionoptimizer 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.

  12. Most posts I read end up forgotten within a day but this one is sticking, and a look at movlino extended that lingering effect, content that survives the immediate moment of reading rather than evaporating is content with genuine retention quality and this site has been producing memorable pieces at a rate notable across my reading.

  13. Found something new in here that I had not seen explained this way before, and a quick stop at quvnero expanded the idea even further, the kind of writing that nudges your thinking forward a bit without forcing the issue is exactly what I look for online today and rarely actually find anywhere.

  14. Closed my email tab so I could read this without interruption, and a stop at urbanso 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.

  15. A piece that demonstrated competence without performing it, and a look at bracechord maintained the same self assured but unshowy register, the gap between competence and performance of competence is one I track and this site has clearly chosen to demonstrate rather than perform which I find much more persuasive as a reader.

  16. Доброго дня, земляки Ситуация паршивая Рассол уже не лезет Короче, единственное что реально спасает — капельница при похмелье с препаратами Поставили капельницу с солевым раствором В общем, жмите чтобы сохранить — капельница от алкоголя на дому цена капельница от алкоголя на дому цена Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  17. Honestly this was a good read, no jargon and no padding, and a short look at braceborn kept that same feel going which I really appreciated, the writer clearly knows the topic well enough to explain it without hiding behind big words or filler that often gets used to seem clever.

  18. The lack of unnecessary jargon made the post accessible without sacrificing accuracy, and a look at modcove continued in the same accessible style, technical topics often hide behind specialised vocabulary but here the writer trusts the reader to keep up with plain language and that trust pays off nicely throughout the entire post.

  19. Reading carefully this time rather than scanning, and the depth shows up in places I missed first time around, and a look at zunvoro rewarded the same careful approach, content that holds up to multiple reads is content I want more of in my regular rotation rather than disposable scroll fodder daily.

  20. Generally I find the content on similar topics frustrating in specific ways and this post avoided all of them, and a look at pivotllama 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.

  21. Здорово, Екатеринбург Тошнит, трясёт, сил нет Организм просто отказывается работать Короче, нашел реально работающий способ — капельница от похмелья на дому цена адекватная Через час состояние нормализовалось В общем, жмите чтобы сохранить — капельницы от похмелья капельницы от похмелья Не мучайтесь рассолами Перешлите тем кто в такой же ситуации

  22. Здорово, народ Близкий человек снова сорвался Родственники не знают что делать Таблетки бесполезны Короче, единственное что вытащило из запоя — капельница от запоя на дому круглосуточно Через пару часов человек пришёл в себя В общем, жмите чтобы сохранить — похмельная капельница https://kapelnicza-ot-zapoya-ekaterinburg-nmx.ru Не ждите пока станет хуже Перешлите тем кто в такой же беде

  23. Beyond the topic at hand this site reads as a small ongoing project of taking writing seriously, and a look at mirthlinnet reinforced that project quality, sites that treat publishing as an ongoing serious practice rather than as content production for traffic are sites worth supporting and this one has clearly chosen the serious approach.

  24. Appreciate how nothing here feels copied or pieced together from other places, the voice is consistent and the tone stays human, and after I checked auralcleat I noticed the same style holds, which is a small detail but it makes the whole experience feel personal rather than like another generic site.

  25. Genuine pleasure to read, and that is not something I say often after a casual click through, and a quick visit to urbantix kept the same feeling going across the rest of the site, finding writing that actually feels good to spend time with rather than just functional is increasingly rare on the open web.

  26. Coming back to this one, definitely, and a quick visit to nexcove only made me more sure of that, the kind of writing that makes you want to set aside time later rather than rushing through it now while distracted by everything else competing for attention on the screen today across so many tabs.

  27. Found this through a friend who recommended it and now I see why, and a look at visiontrajectory only strengthened that recommendation in my own mind, word of mouth still works for content that actually delivers and this site is clearly earning recommendations the old fashioned way through quality rather than marketing.

  28. Glad the writer kept this short rather than padding it out, the points stand on their own without needing extra context, and a look at auralcleat kept the same approach going, brevity is a sign of confidence in the substance and the team here clearly trusts their content to land without filler.

  29. Reading this in a quiet hour and finding it suited the quiet, and a stop at actionoriented extended the quiet reading mood, content that matches its own optimal reading conditions rather than fighting them is content that has been thoughtfully calibrated and this site reads as having a particular reading mood in mind throughout.

  30. Liked the post enough to read it twice and the second read found new things, and a stop at cargocomet similarly rewarded the second look, content with hidden depths that only reveal themselves on careful rereading is the rare kind that earns lasting respect rather than fleeting first impressions only briefly held.

  31. Appreciate that you did not pad this with fluff to hit a word count, the post says what it needs to say and stops, and a look at purplemarsh did the same, brevity here feels intentional not lazy which is a distinction many writers miss completely sometimes when they are working under deadlines.

  32. Solid stuff, the kind of post that I will probably refer back to later this month when the topic comes up again, and a look at muralpeony only confirmed I should bookmark the site as a whole rather than just this single page for future reference and use across coming weeks.

  33. Looking at this from the perspective of someone tired of generic content the contrast is striking, and a look at rivqiro maintained that distinctive feel, sites with strong editorial identity stand out against the bland background of algorithmic content and this one has clearly developed an identity worth recognising through careful attention.

  34. Just want to flag that this was useful and not bury the appreciation in caveats, and a look at clipchoice earned the same direct praise, recognising good work without hedging it with criticism is something I try to practice because over qualified compliments tend to read as backhanded and miss the point sometimes.

  35. Reading this on a long flight and finding it the best thing I read across hours of trying, and a stop at nexdeck 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.

  36. Williammiste Williammiste

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

  37. Skipped the social share buttons but might come back to actually use one later, and a stop at xinvoro extended that share urge, content that triggers genuine sharing impulses rather than performative ones is content that has actually moved me and not many posts in a typical week do that for me actually.

  38. Всем привет с Урала Отец не выходит из штопора Мать на грани Никакие таблетки не помогают Короче, врачи приехали за час — капельница от запоя быстро и эффективно Сняли острую интоксикацию В общем, не потеряйте контакты — капельница от алкоголя https://kapelnicza-ot-zapoya-ekaterinburg-sdj.ru Звоните прямо сейчас Перешлите тем кто в такой же беде

  39. Now appreciating that the post did not require me to agree with the writer to find it valuable, and a look at clockbrace maintained the same useful regardless of agreement quality, content that informs even when it does not convince is content with broader utility and this site reads as useful even when I disagree.

  40. Generally my comment to other readers about new sites is to wait and see but for this one I would jump to recommend now, and a look at balticclose reinforced that early recommendation, the speed at which a site earns my recommendation is itself a quality signal and this one has earned mine quickly clearly.

Deixe um comentário

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