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.

2.965 Comentários

  1. Marcussmobe Marcussmobe

    На данном этапе специалист уточняет, как долго продолжается запой, какой вид алкоголя употребляется и имеются ли сопутствующие заболевания. Тщательный анализ информации позволяет оперативно определить степень интоксикации и выбрать оптимальные методы терапии для быстрого и безопасного вывода из запоя.
    Ознакомиться с деталями – vyvod-iz-zapoya-na-domu tula

  2. happyvaluehub happyvaluehub

    Bookmarked the page and the homepage too because clearly there is more to explore here, and a quick stop at happyvaluehub only made that more obvious, this is the kind of place I want to dig through over a weekend rather than rushing through during a coffee break tomorrow morning before getting back to work.

  3. freshfindshub freshfindshub

    After several visits I am now confident this site is one to follow seriously, and a stop at freshfindshub reinforced that confidence, the gradual building of trust through repeated quality exposures is the only sustainable way to develop reader loyalty and this site is building that loyalty in me through patient consistent work consistently.

  4. thetrendstore thetrendstore

    Granted my mood today might be elevating my reading experience but I still think this is genuinely good, and a stop at thetrendstore reinforced that even discounted assessment, controlling for the mood adjustment that affects content perception this site still reads as substantively above average across multiple pieces I have read carefully today.

  5. brightfashionoutlet brightfashionoutlet

    Liked the careful selection of which details to include and which to skip, and a stop at brightfashionoutlet reflected the same editorial judgement, knowing what to leave out is just as important as knowing what to include and this site has clearly figured out where that line sits for the topics it covers regularly.

  6. connectandcreate connectandcreate

    Looking through the archives suggests this site has been doing this for a while at this level, and a look at connectandcreate confirmed the long term consistency, sites that have maintained quality across years rather than just a recent stretch are sites with serious editorial discipline and this one has clearly been at it for a while.

  7. goldenrootmart goldenrootmart

    Worth flagging this site to a few specific friends who would appreciate the editorial sensibility, and a look at goldenrootmart added more pages I will mention to them, recommending sites to specific people requires understanding both the site and the person and this site is making those personalised recommendations easy and natural for me.

  8. joltfork joltfork

    Stands out for actually being useful instead of just being long, and a look at joltfork 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.

  9. freshfindshub freshfindshub

    After several visits I am now confident this site is one to follow seriously, and a stop at freshfindshub reinforced that confidence, the gradual building of trust through repeated quality exposures is the only sustainable way to develop reader loyalty and this site is building that loyalty in me through patient consistent work consistently.

  10. connectandcreate connectandcreate

    Will recommend this to a couple of friends who have been asking about this exact topic, and after connectandcreate I have even more reason to do so, the kind of site that earns word of mouth rather than chasing it through aggressive marketing or paid placements is always a treat to find online.

  11. brightfashionoutlet brightfashionoutlet

    A piece that read smoothly because the writer understood how readers actually move through prose, and a look at brightfashionoutlet maintained the same reader awareness, writers who think about the reading experience as much as the writing experience produce better work and this site has clearly made that shift in editorial approach.

  12. uniquefashioncorner uniquefashioncorner

    After reading several posts back to back the consistent voice across them is impressive, and a stop at uniquefashioncorner continued that voice consistency, sites that maintain a single coherent voice across many pieces by potentially many writers represent serious editorial discipline and this one has clearly developed the institutional consistency needed for that.

  13. betterbasket betterbasket

    Got something practical out of this that I can apply later this week, and a stop at betterbasket added more details to think about, this is exactly the kind of content I bookmark for future reference rather than the throwaway listicles that dominate most search results these days for almost any common topic.

  14. zingtorch zingtorch

    Now feeling mildly impressed in a way I do not quite remember feeling about a blog in a while, and a stop at zingtorch 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.

Deixe um comentário

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