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

  1. 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 93tv did the same, brevity here feels intentional not lazy which is a distinction many writers miss completely sometimes when they are working under deadlines.

  2. Speaking from the perspective of having read widely on the topic this site offers something distinct, and a look at gongjade 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.

  3. A genuinely unexpected highlight of my reading week, and a look at 932ka extended that pattern, the surprise of finding excellent content rather than the predictable mediocre is one of the few real pleasures of casual web browsing and this site delivered that surprise cleanly today which I really do appreciate.

  4. Compared to the usual results for this kind of search this site stands well above the average, and a quick visit to ironfleet kept the standard high, you can tell within seconds whether a site is going to waste your time or actually deliver and this one clearly delivers without any false starts.

  5. Found this through a search that was generic enough I did not expect quality results, and a look at gapkraft continued the surprisingly good experience, search engines occasionally still surface excellent independent content if you scroll past the obvious paid and high authority results which is reassuring to remember sometimes.

  6. Слушайте кто недавно кухню делал Цены задрали как на золото То ручки через месяц шатаются Короче, реальное производство в Питере — кухни в спб от производителя с гарантией Кромка немецкая 2 мм В общем, смотрите сами по ссылке — купить кухню на заказ в спб https://kuhni-spb-nbg.ru Проверяйте производителя по этому списку Перешлите тому кто тоже мучается

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

  8. Will share this on a forum I am part of where it will be appreciated by others working in the same area, and a look at ynl3uklt suggests there is more here worth passing along too, definitely a generous resource that deserves a wider audience than it probably has today across the open internet.

  9. Glad the writer did not feel compelled to cover every possible angle of the topic, focus is a virtue, and a stop at tennisvortex 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.

  10. Please let me know if you’re looking for a writer for your blog.
    You have some really good articles and I believe I
    would be a good asset. If you ever want to take some
    of the load off, I’d absolutely love to write some articles for your blog in exchange for a link back to mine.

    Please blast me an email if interested. Thank you!

  11. united kingdom casino no deposit bonus codes
    2021, canadian online casino no deposit bonus codes and
    new no deposit casino bonus uk, or real money gambling in games online (Rolando) casino united states reviews

  12. online tutorial gambling site (Mira) legal in united states,
    mini slot machine united states and cahuilla casino anza california, or buy bingo game australia

  13. Top tier post, the kind that makes you want to share the link with friends working in the same area, and a stop at teapotshrine only made me more confident in doing that, this site is one of the better resources I have seen on the topic recently across both new and older posts.

  14. casino bonus buy usa, united kingdom online
    casino free bonus no deposit required and dollar 1 deposit casino new no
    deposit spins 2021, Lashawnda,
    zealand, or top online pokies and casinos canadian open 2021

  15. Came here from another site and ended up exploring much further than I planned, and a look at gulfholm only encouraged more exploration, the kind of place where one click leads to another not through manipulative design but through genuinely interesting content is rare and worth highlighting when found like this somewhere on the open internet.

  16. Anthonyrok Anthonyrok

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

  17. Now wondering how the writers calibrated the level of detail so well, and a stop at stencilveto 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.

  18. Coming back to this one, definitely, and a quick visit to ideasneedexecution 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.

  19. Thanks for keeping things clear and to the point, that is honestly hard to find online these days, and after reading through fumefinch the message stayed consistent which makes me trust the information being shared more than I usually do on similar pages that cover this same kind of topic.

  20. Reading this on a difficult day was a small bright spot, and a stop at sampleshaft extended that brightness, content that improves a hard day is content that has earned a particular kind of place in my reading habits and this site is occupying that uplifting role for me today which I appreciate clearly.

  21. However many similar pages I have read this one taught me something new, and a stop at slacktally 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.

  22. 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 veilshore 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.

  23. Reading this in the morning set a good tone for the day, and a quick visit to impaladenim kept that good tone going, content can do that sometimes when it hits the right notes and finding sites that consistently strike that tone is something I have learned to recognise and reward with regular visits.

  24. usa usd 200 no deposit bonus 200 free spins 2021, advanced roulette uk and
    casino apps (Pansy) for real money australia, or free chips no deposit bonus united states

  25. Probably going to mention this site in a write up I am working on later this month, and a stop at herbharp 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.

  26. jackpot city casino borgata nj online casino app (Declan) united
    states, gambling stocks united states and australian casino apps, or new online casino australia 2021

  27. If you asked me to point to a recent positive sign for the open web this site would be near the top, and a stop at herbharp reinforced that designation, the few sites that serve as evidence the web can still produce quality independent content are precious and this one has clearly become one for me.

  28. Now noticing that the post benefited from being neither too short nor too long for its content, and a look at flockfine continued that calibration of length, sites that match length to content rather than padding to hit some target are sites that respect both their material and their readers and this site does both.

  29. Now feeling mildly impressed in a way I do not quite remember feeling about a blog in a while, and a stop at 67kpwtu extended that mild impression, content that produces specific positive emotional responses rather than just neutral information transfer is content with extra dimensions and this site has those extra dimensions clearly.

  30. Felt mildly happier after reading, which sounds silly but is true, and a look at suburbvesper 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.

  31. Felt mildly happier after reading, which sounds silly but is true, and a look at grebeheron 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.

  32. Now recognising that this site has earned a place in the small group of resources I treat as authoritative, and a stop at soontornado 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.

  33. Started imagining how I would explain the topic to someone else after reading, and a look at globeflame gave me more material for that imagined explanation, content that improves my own ability to discuss a topic is content that has actually transferred knowledge rather than just decorating my screen for a few minutes.

  34. Now adjusting my mental list of reliable sites for this topic, and a stop at stereotarot reinforced the adjustment, the small ongoing curation work of maintaining trusted sources is one of the actual practical activities of careful reading and this site has earned a permanent place on my list for this particular subject.

  35. Closed the tab and immediately reopened it ten minutes later because I wanted to reread a part, and a stop at stitchteal 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.

Deixe um comentário

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