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

  1. JamesGot JamesGot

    В этой статье мы говорим о важности поддержки в процессе выздоровления. Рассматриваются семьи, группы поддержки, специалисты и онлайн-ресурсы, которые могут сыграть решающую роль в избавлении от зависимости.
    А есть ли продолжение? – вывод из запоя на дому ростов

  2. AlvinHed AlvinHed

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

  3. Worth observing that the post landed without needing a flashy headline to hook attention, and a stop at learnsomethingnewtoday did the same, content that earns engagement through substance rather than packaging is the kind I trust more deeply and this site has clearly chosen substance as the primary lever for reader engagement throughout.

  4. A piece that left me thinking I had been undercaring about the topic, and a look at smartshoppingzone reinforced that mild concern, content that raises the appropriate weight of a subject without being preachy about it is doing important work and this site is providing that gentle elevation of attention for me consistently.

  5. If I had to summarise the editorial sensibility of this site in a few words it would be careful and human, and a look at makesomethingnew extended that summary feeling, capturing the essence of a sites approach in brief is hard but this site has a clear enough identity that the summary comes naturally enough.

  6. Just nice to read something that does not feel like it was assembled from a content brief, and a stop at everydaystylemarket 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.

  7. Recommended without reservation for anyone interested in the topic at any level of expertise, and a look at yourpathforward only strengthens that recommendation, this site clearly knows how to serve readers across a range of backgrounds without watering down the content or talking past anyone in the audience which is genuinely impressive to see.

  8. Now feeling that this site is the kind I want to make sure does not disappear, and a look at dailytrendmarket reinforced that quiet protective feeling, the rare sites whose disappearance would actually matter to me are the sites I want to support through return visits and recommendations and this one has joined that small protected list.

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

  10. Good clean post, no errors and no awkward phrasing that breaks the reading flow, and a stop at shopandsaveonline kept the same standard, definitely the kind of editorial care that earns a return visit because it tells me the writer is paying attention to details that matter to readers rather than just rushing publication.

  11. A piece that left me thinking I had been undercaring about the topic, and a look at exploreinnovativeideas reinforced that mild concern, content that raises the appropriate weight of a subject without being preachy about it is doing important work and this site is providing that gentle elevation of attention for me consistently.

  12. Liked that the post landed without needing to manufacture controversy or take a contrarian stance for attention, and a stop at ranknexus continued that grounded approach, content that earns attention through quality rather than provocation is the kind that builds long term trust rather than burning it on quick wins.

  13. A piece that demonstrated competence without performing it, and a look at dreambiggeralways 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.

Deixe um comentário

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