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.

5.413 Comentários

  1. Если честно, сам перерыл кучу форумов в поисках нормальной ткани для мебели. Оказалось, что выбрать подходящий вариант тот ещё квест. Итак, смотрите, вот здесь реально толково расписано про плотность, ворс и износостойкость для диванов и кресел, а главное — показаны варианты, которые легко чистить. Вся полезная информация доступна здесь: волокно для мебели https://tkan-dlya-mebeli-2.ru Дальше сами гляньте каталог с ценами. Да, и не берите первое, что попалось — я уже обжёгся, когда брал мебельную ткань купить с рук. Эта тема реально вывозит по износу. Для информации: ткань мебельная купить лучше уже с нормальной пропиткой от грязи. Да и садится такое полотно гораздо меньше. Не поленитесь, откройте.

  2. Honest assessment after reading this twice is that it holds up under careful attention, and a look at fairfinch extended that durability across more pages, content that survives a second read without revealing weak spots is rarer than the average reader probably realises and this site clearly cleared that bar.

  3. Just sat with this for a bit longer than I usually would because the points are worth thinking about, and after explorebetterthinking I had even more to chew on, the kind of post that nudges your thinking forward without forcing the issue is something I have always appreciated in good writing online.

  4. Generally I am cautious about recommending sites on first encounter but this one warrants the exception, and a look at explorefuturepathways reinforced the exception making, the rare site that justifies breaking my normal cautious approach is the rare site worth flagging early and this one has prompted exactly that early flagging response from me.

  5. Açıkçası bu işe yeni başlayanlar için ideal. Sürekli adres değişiyor derler ya işte tam da o hesap. Detaylı güncellemeleri kontrol edip süreci sorunsuz başlattım. Güvenilir bir kaynak bulmanın ne kadar zor olduğunu hepimiz biliyoruz işte size o adres: 1xbet spor bahislerinin adresi 1xbet spor bahislerinin adresi. Yani demem o ki şöyle söyleyeyim — spor bahislerine meraklıysanız burası tam size göre.

    Hiçbir sıkıntı yaşamadım bugüne kadar oynarken. Birçok yeri denedim ama burada karar kıldım — kesinlikle pişman olacağınızı sanmıyorum deneyin. Herkese hayırlı olsun…

  6. Skipped to a specific section because I knew that was the question I had, and the answer was clean, and a stop at ideasintoresults similarly delivered targeted answers without burying them, content engineered for readers who arrive with specific needs rather than open ended browsing is increasingly valuable in a search heavy reading environment.

  7. Reading this slowly to absorb the structure, and the structure is doing real work alongside the words, and a look at jetdomes maintained the same architectural quality, when sentence shapes and paragraph rhythms reinforce the meaning rather than just transporting words you know you are reading skilled work today.

  8. Now adding this site to a small mental group of recommendations I keep ready for specific kinds of inquiries, and a stop at fernpiers extended the recommendation readiness, content that I can confidently point friends and colleagues toward in specific contexts is content with real social utility and this site has that utility clearly.

  9. Now thinking the topic is more interesting than I had given it credit for, and a stop at createimpactplanningnow continued that elevated interest, content that revives my curiosity about subjects I had set aside is doing genuine work in the structure of my interests and this site is providing that revivifying effect today actually.

  10. Came away with a small but real shift in perspective on the topic, and a stop at startmovingforward pushed that shift a bit further, the kind of subtle reframing that good writing does to a reader without making a big deal of it is something I always appreciate when it happens which is sadly not that often.

  11. Closed it feeling slightly more competent in the topic than I started, and a stop at loopbough reinforced that competence boost, real learning is rare in casual online reading but it does happen sometimes and this site managed to make it happen for me today which is genuinely worth pausing to acknowledge.

  12. Solid value packed into a relatively short post, that takes skill, and a look at executeideasclean continues the dense useful content across more pages, this site clearly understands that respecting reader time is itself a form of generosity which is something most blog operations seem to have forgotten lately across the wider open web.

  13. Closed the post with a small satisfied sigh, and a stop at duetparishs produced the same gentle exhale, content that ends well is content that respects the rhythm of reading and the writers here have clearly thought about how their pieces close rather than just trailing off when they run out of things to say.

Deixe um comentário

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