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.239 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/

  11. Edwardred Edwardred

    Одним из ключевых достоинств выезда нарколога на дом является возможность лечения в привычной для пациента среде, что способствует снижению стресса и ускоряет процесс выздоровления. Кроме того, лечение на дому гарантирует полную анонимность и индивидуальный подход к каждому пациенту.
    Углубиться в тему – нарколог на дом цены иркутск

  12. Recommended to anyone working in or curious about this area, the depth and clarity combine well, and a look at webgorge keeps that going across more pages, the kind of site that earns regular visits rather than chasing trends has my respect because it suggests genuine commitment to the topic itself rather than to chasing trends.

  13. После первичной диагностики начинается активная фаза медикаментозного вмешательства. Современные препараты вводятся капельничным методом, что позволяет быстро снизить уровень токсинов в крови и восстановить нормальные обменные процессы, стабилизируя работу печени, почек и сердечно-сосудистой системы.
    Подробнее – вывод из запоя недорого в донецке

  14. Coming to this with low expectations and being pleasantly surprised by the substance, and a stop at lockandloadshop continued exceeding expectations, the recalibration of expectations upward across multiple positive readings is one of the actual rewards of careful browsing and this site is providing that recalibration at a steady rate apparently.

  15. Interesting post here. One thing I would like to say is most professional career fields consider the Bachelor Degree just as the entry level standard for an online diploma. While Associate Certifications are a great way to get started on, completing your Bachelors opens up many good opportunities to various employment goodies, there are numerous online Bachelor Diploma Programs available from institutions like The University of Phoenix, Intercontinental University Online and Kaplan. Another concern is that many brick and mortar institutions make available Online types of their qualifications but usually for a greatly higher cost than the institutions that specialize in online higher education degree plans.

  16. legitimate australian online casinos, nyc casino jfk (Robbin) chips
    value usa and online slots free bonus no deposit uk, or gambling facts
    australia

Deixe um comentário

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