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

  1. EdwardoDoola EdwardoDoola

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

  2. Now appreciating that the post did not try to imitate any other style I might recognise, and a stop at cashcompass continued that distinct voice, content with its own register rather than borrowed from elsewhere is content with real authorial presence and this site has clearly developed that presence through what feels like patient editorial work.

  3. Thanks for laying this out in a way that someone newer to the topic can follow, and a stop at monitormerchant kept that accessibility going, writing that meets readers at different experience levels without condescending is hard to do well and the writers here have clearly thought about who they are writing for.

  4. Charlestof Charlestof

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

  5. Considered as a whole this site has developed a coherent point of view that comes through in individual pieces, and a look at lilyluxe continued displaying that coherence, sites with a unified perspective rather than a grab bag of takes are sites with editorial maturity and this one has clearly developed that maturity through years of work.

  6. Approaching this site through a casual link click and being surprised by what I found, and a look at blog44fish extended the surprise, the rare experience of stumbling into excellent independent content rather than predictable mediocrity is one of the actual remaining pleasures of casual web browsing and this site provided it cleanly.

  7. Now I want to find more sites like this but I suspect they are rare, and a look at goldgraph extended that thought, the few sites that meet this quality bar are precious specifically because they are rare and finding others like them is one of the ongoing projects of careful internet curation across the years.

  8. Reading this with my morning coffee turned into reading the related posts with my morning coffee, and a stop at yottamart stretched the morning further, content that pulls breakfast into a reading session rather than just accompanying it is content that has earned a higher claim on my attention than the average article does.

  9. Came in skeptical of the angle and left mostly persuaded, and a stop at conversioncove pushed me a bit further in the same direction, content that can move a critical reader by argument rather than rhetoric is rare and worth pointing out because it indicates real substance underneath the surface presentation here.

  10. JesusDar JesusDar

    После первичной диагностики начинается активная фаза медикаментозного вмешательства. Современные препараты вводятся капельничным методом, что позволяет быстро снизить уровень токсинов в крови и восстановить нормальные обменные процессы, стабилизируя работу печени, почек и сердечно-сосудистой системы.
    Получить больше информации – http://vyvod-iz-zapoya-donetsk-dnr0.ru/

Deixe um comentário

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