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

  1. Definitely returning here, that is decided, and a look at buildfuturefocusedpaths only made the case stronger, this is one of those rare websites that rewards regular visits rather than feeling stale after the first read which is something I cannot say about most of the places I bookmark today across all my topics.

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

  3. 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 simpleecommercesolutions 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.

  4. Really appreciate that the writer did not assume I would read every other related post first, and a look at discoverbetterapproaches kept that self contained feel going where each piece can stand alone, accessibility for new readers is a sign of generous editorial thinking and this site has clearly invested in that approach.

  5. Stands out for actually being useful instead of just being long, and a look at clickforbetterdecisions kept that going, length without value is the default mode of most blogs these days but this site has clearly chosen a different path which I respect a lot as a reader who values careful editing decisions like that.

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

  7. Bookmark added with a small note about why, and a look at longtermvaluepartnership prompted another bookmark with another note, the bookmarks I annotate are the ones I expect to return to deliberately rather than stumble into and this site is generating annotated bookmarks at a higher rate than my usual content sources by some margin.

  8. Bookmark added in three places to make sure I do not lose the link, and a look at businesstrustinfrastructure got the same redundant treatment, sites I am afraid to lose are the rare keepers and this is clearly one of them based on what I have read so far across this and a couple of related posts.

  9. Halfway through I knew I would finish the post, and a stop at reliablepurchasehub also held me through to the end, content that signals its quality early and then sustains it is content with real internal consistency and this site has clearly figured out how to maintain quality from opening sentence through to closing thought.

  10. Generally I do not leave comments but this post merits a small note, and a stop at clickforpracticalsolutions extended that comment worthy quality, the urge to actively contribute to a sites community rather than passively consume from it is something specific content provokes and this site has provoked that engagement urge from me today.

  11. Genuinely useful read, the points are practical and easy to apply right away, and a quick look at globalbusinessunity confirmed that this site is consistent in that approach, looking forward to digging through the rest of it when I get the chance to sit down properly later in the week or this weekend.

  12. BrandonWix BrandonWix

    В Новороссийске круглосуточная наркологическая служба работает без выходных, ночью, в праздники и в любое время суток. Наркологическая служба работает по принципу круглосуточного дежурства, что позволяет оказать быструю помощь в экстренных случаях. При обращении по телефону оператор уточняет адрес, контакты, состояние больного, длительность приема алкоголя или наркотиков, наличие хронических заболеваний, противопоказания, жалобы, симптомы и необходимость срочного выезда.
    Ознакомиться с деталями – http://narkolog-na-dom-v-novorossijske2.ru

  13. Right now it looks like Expression Engine is the preferred blogging platform out there right now. (from what I’ve read) Is that what you’re using on your blog?

  14. Now feeling confident enough in this site to use it as a reference point for evaluating others on the same topic, and a look at discoverbetterapproaches continued the comparison friendly quality, sites that serve as quality benchmarks for their topic are precious and this one has clearly become a benchmark for me on this particular subject area.

  15. A clean read with no irritations, and a look at qorivogroup 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.

  16. Honestly informative, the writer covers the ground without showing off, and a look at ulvix reflected the same humility, content that respects the reader rather than trying to dazzle them is something I always appreciate and rarely come across in this corner of the internet today across the topics I usually read.

  17. Williamgrisp Williamgrisp

    Продолжительное употребление алкоголя вызывает опасные последствия для здоровья из-за сильной алкогольной интоксикации, а также наносит вред многим другим факторам, влияющим на качество жизни. Запой разрушает работу внутренних органов, приводит к обезвоживанию, нарушению солевого баланса, повышению давления, сбоям сердечно-сосудистой системы, обострению хронических заболеваний, депрессии, страху, бессоннице и неадекватному поведению. Чем дольше больной продолжает пить, тем больше токсинов накапливается в крови, тем тяжелее проходит процесс выхода из запойного состояния и тем выше вероятность инфаркта, инсульта, психоза, делирия, судорожных припадков и других тяжелых последствий.
    Получить дополнительные сведения – https://vyvod-iz-zapoya-v-novorossijske2.ru/

  18. Just nice to read something that does not feel like it was assembled from a content brief, and a stop at longtermvaluealliances kept that handcrafted feel going, you can tell when a real human with real understanding is behind the words versus a templated piece churned out for an algorithm to find.

Deixe um comentário

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