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.

8.944 Comentários

  1. Liked the natural conversational tone throughout, never stiff and never overly casual either, and a stop at exabuff kept that comfortable middle ground going, finding a tone that respects the reader without becoming distant or overly familiar is harder than it sounds and this site nails that balance consistently across many different pieces.

  2. Thanks for the clean writing, no broken sentences and no awkward translations like some other sites have, and a quick stop at apricotharbormerchantgallery kept that polish going nicely, it really does make a difference when a reader can move through a page without tripping on every line or going back to reread.

  3. Привет из Нижнего. Брат уже пятые сутки не просыхает. Мать рыдает. Скорая не считает это проблемой. Итог, реально профессиональные врачи — наркологическая помощь на дому срочно. Приехали через 35 минут. В общем, все контакты по ссылке — нарколог наркологическая помощь нарколог наркологическая помощь Звоните прямо сейчас. Отправьте тем, кто рядом с бедой.

  4. Glad the writer kept this short rather than padding it out, the points stand on their own without needing extra context, and a look at apricotharbormerchantgallery kept the same approach going, brevity is a sign of confidence in the substance and the team here clearly trusts their content to land without filler.

  5. Thank you for keeping the writing honest and the points easy to verify against your own experience, and a stop at uptonvinyl reflected the same approach, no exaggeration just steady useful content that I can take with me into my own work without second guessing every sentence I happen to read here.

  6. Привет из Нижнего. Отец снова ушёл в штопор. Дети напуганы до смерти. В диспансер тащить — позор на район. Итог, выручила только эта клиника — частная наркологическая помощь анонимно. Врач осмотрел и поставил капельницу. В общем, цены и телефон тут — наркологическая клиника анонимная помощь нарколога наркологическая клиника анонимная помощь нарколога Не медлите. Вдруг это спасёт жизнь.

  7. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  8. Всем привет из северной столицы. Близкий человек уже пятые сутки в запое. Дети боятся оставаться с отцом. В диспансер везти — позор на район. Короче, спасла только эта бригада — вывод из запоя на дому круглосуточно. Приехали за 30 минут. В общем, жмите, чтобы сохранить — вывод из запоя с выездом на дом вывод из запоя с выездом на дом Звоните прямо сейчас. Вдруг это спасёт чью-то жизнь.

  9. Bookmark earned and shared the link with one specific person who would care, and a look at faelex got the same targeted share, sharing carefully rather than broadcasting is a discipline I try to maintain and this site is generating shares from me at a sustainable rate rather than the spam rate of viral content.

  10. Доброго времени суток. Отец уже вторую неделю не просыхает. Дети боятся оставаться дома. Государственные клиники — только учёт и очереди. Итог, выручила только эта клиника — наркологическая помощь недорого в Нижнем Новгороде. Врач осмотрел и начал капельницу. В общем, не потеряйте — наркологическая клиника стоимость https://narkologicheskaya-pomoshh-nizhnij-novgorod-ksc.ru Не тяните с решением. Перешлите тем, кто в отчаянии.

  11. Coming back tomorrow when I can give this a proper read, the post deserves better attention than I can give right now, and a look at focusbuildsvelocity suggests there is plenty more here that deserves the same treatment, definitely a site I will be exploring properly over the next few days when I can.

  12. Worth saying that the post fit naturally into a rhythm of careful reading, and a stop at brightharborcommercegallery extended the same rhythm, content that pairs well with how I actually read rather than demanding a different mode is content well calibrated to its likely audience and this site has clearly thought about that consistently.

  13. Здорова, народ. Мой знакомый уже шестой день в запое. Родные просто в отчаянии. В государственный диспансер — табу. Короче, реально крутые специалисты — выведение из запоя на дому анонимно. Примчались за 25 минут. В общем, жмите, чтобы сохранить — вывод из запоя в спб вывод из запоя в спб Не ждите, пока станет хуже. Вдруг это спасёт чью-то семью.

  14. Genuinely changed how I think about a small piece of the topic, which does not happen often online, and a look at falbell added another nudge in the same direction, the kind of writing that earns a small mental shift rather than just confirming what you already thought before reading is a sign of careful thought.

  15. Привет из Екб. Отец не встаёт с дивана. Дети всего боятся. Скорая помощь просто разводит руками. В итоге, реально крутые специалисты — вывод из запоя на дому анонимно. Сняли алкогольную интоксикацию. В общем, жмите, чтобы сохранить — выведение из запоя на дому в екатеринбурге https://vyvod-iz-zapoya-na-domu-ekaterinburg-mfk.ru Каждый час усугубляет состояние. Вдруг кому-то это спасёт жизнь.

  16. Доброго вечера. Брат снова ушел в штопор. Родственники на взводе. В наркологию везти — страшно. В итоге, единственные кто быстро приехал и помог — круглосуточный вывод из запоя с выездом. К ночи человек пришёл в себя. В общем, не потеряйте, пригодится — вывод из запоя недорого вывод из запоя недорого Не ждите. Отправьте тем, кто рядом с бедой.

  17. Decided to set aside time later to read more carefully, and a stop at acorndamson reinforced that decision, content that earns a calendar entry rather than just a passing read is in a different tier altogether and this site is clearly working at that elevated level which I really do appreciate as a reader today.

  18. Came in tired from a long day and the writing held my attention anyway, and a stop at adobebronze kept that going, content that can engage a fatigued reader is doing something right because most online reading happens in suboptimal conditions like that one and quality content adapts to it without complaint.

  19. Здорова, Питер. Отец не выходит из штопора. Соседи уже вызывали полицию. Платная наркология — грабёж. Короче, спасла эта бригада — недорогой вывод из запоя в Санкт-Петербурге. К утру человек пришёл в себя. В общем, не потеряйте — врач капельница алкоголь на дом врач капельница алкоголь на дом Звоните прямо сейчас. Перешлите тем, кто рядом с бедой.

Deixe um comentário

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