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.

6.561 Comentários

  1. JulioInino JulioInino

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

  2. In the middle of an otherwise scattered day this post landed as a moment of focus, and a stop at ferretiguana extended that focused feeling across more pages, content that anchors a fragmented day rather than contributing to the fragmentation is content with real centring effect and this site is providing that anchoring function for me.

  3. A piece that did exactly what it promised in the headline without overshooting or underdelivering, and a look at actionwithdirection continued that calibration, alignment between promise and delivery is a basic editorial virtue that many sites fail at and this site has clearly mastered the matching of expectation and substance throughout pieces.

  4. I came here looking for a quick answer and ended up reading the whole post because it was actually interesting, and after clarityprogression I had a much fuller picture, no stress and no confusion just a clear walk through the topic that made everything fall into place without much effort.

  5. Now considering writing a longer note about the post somewhere, and a look at glacierglaze added more material for that note, content that prompts me to write rather than just consume is content with generative energy and this site is producing that generative effect for me at a higher rate than most sources.

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

  7. The structure of the post made it easy to follow without losing track of where I was, and a look at cougararbor kept the same logical flow going, this site clearly understands that organisation is half the battle in keeping readers engaged from the first line to the last across any kind of post.

  8. Jamesacade Jamesacade

    В этой публикации мы предложим ряд рекомендаций по избавлению от зависимостей и успешному восстановлению. Мы обсудим методы привлечения поддержки и важность самосознания. Эти советы помогут людям вернуться к нормальной жизни и стать на путь выздоровления.
    Получить дополнительные сведения – анонимная наркологическая клиника

  9. Okay folks gather around because this Miami rental nightmare needs to be discussed. You see a sweet ride online — clean spec, fair price, looks legit. Plus they want a $2000 hold on your debit card. Fool me five times? Actually yeah, Miami keeps fooling everyone. that’s exactly how they hook you. Miami without proper wheels is basically a hostage situation. leather seats that don’t fuse to your skin in August. I’ve gone through maybe 30 rental companies across Dade, Broward, and Palm Beach. Finally found one outfit that actually delivers what’s in the listing. Here’s the only honest broker for premium vehicles across South Florida
    south beach luxury car rental https://luxury-car-rental-miami-5.com Yeah finding parking in Wynwood will test your patience — but that’s not on them. Anyway glad there’s at least one straight shooter left in this rental jungle.

Deixe um comentário

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