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

  1. Worth bookmarking and sharing with anyone interested in the topic, that is my honest take, and a stop at duetparish reinforces that, the kind of generous resource that makes the open web feel worth defending against the constant pressure to retreat into walled gardens and curated feeds today everywhere I look across all my devices.

  2. The pacing of the post was just right, never rushed and never dragged out unnecessarily, and a look at micapact maintained the same rhythm, you can tell the writer has experience because the difficult skill of pacing is something only practiced writers manage to handle well in long form content over time and across formats.

  3. Народ, привет! Такая ситуация — на планерке сказали срочно найти подарки для клиентов. Присматриваюсь к подаркам с логотипом, но боюсь нарваться на кривую печать. заказать сувенирную продукцию заказать сувенирную продукцию Говорят, сейчас модно заказывать корпоративные подарки сувениры из экокожи — но кто делает качественно. Просили ещё брендированные кружки и толстовки. А то я уже второй день в интернете сижу и ничего адекватного не нашёл.

  4. Started this morning and finished at lunch with a small sense of having spent the time well, and a look at irisarbor extended that satisfaction into the afternoon, content that fits naturally into the rhythm of a working day rather than demanding a dedicated reading block is increasingly the kind I prefer.

  5. Now thinking about how to apply some of this to a project I have been planning, and a look at movefromvision added more material for the planning, content that connects to my actual creative work rather than just being interesting in the abstract is the kind that earns priority placement in my reading rotation consistently going forward.

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

  7. Срочно нужен совет тем, кто занимается брендингом. Хотим обновить мерч для сотрудников. Везде говорят про индивидуальный подход, но реально толковое изготовление корпоративных сувениров с печатью по вменяемой цене. сувенирка с логотипом сувенирка с логотипом Интересует именно изготовление под ключ — от кружек до брендированных блокнотов. Пока просто собираем инфу. Заранее спасибо, кто откликнется.

  8. Reading this confirmed that my time researching the topic in other places had not been wasted, and a stop at flarefoil extended the confirmation, when independent sources agree that is a useful signal and this site is one of the more reliable sources I have found for cross checking what I read elsewhere on similar subjects.

  9. Açıkçası ben de merak ediyordum. Birçok site denedim ama. En sonunda her derde deva bir kaynak keşfettim.

    Casino sevenler bilir. Uyarıları dikkate alarak sistemi kurun. Giriş adresi aynen şu şekilde: 1xbet giriş 1xbet giriş. Kısacası — 1xbet güncel adres arayanlar buraya baksın.

    Canlı destek anında yardımcı oluyor. Kimseye zararım dokunmaz — başka yerde aramaya gerek yok. Selametle…

  10. Honestly this was the highlight of my reading queue today, and a look at structureyourgrowth extended that across more pages I will return to, ranking what I read against what else I read each day is something I do informally and this site keeps moving up in those rankings the more I explore it.

  11. Came in expecting another generic take and got something with actual character instead, and a look at dustorchid carried that personality forward, finding a distinct voice on a saturated topic is impressive and worth pointing out when it happens because most sites end up sounding identical to their nearest competitors quickly.

  12. Started reading without much expectation and ended on a high note, and a look at focuscreatesmovement continued that arc, content that builds rather than peaks early is a sign of a writer who knows how to structure a piece for sustained reader engagement rather than relying on a strong hook to do all the work.

  13. Quality you can feel from the first paragraph, the writer clearly knows the topic and how to share it, and a quick look at mintdawn confirmed the same depth runs throughout the rest of the site as well which is rare and worth pointing out when it happens online for any reader passing through.

  14. JesusSpago JesusSpago

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

  15. Easy to recommend, the content speaks for itself without needing additional praise from me, and a stop at irisbureau only adds more reasons to send people this way, the kind of generous resource that benefits its readers without demanding anything in return is increasingly rare and worth recognising clearly today across the broader open internet.

  16. Came across this looking for something else entirely and ended up reading it through twice, and a look at vesselthrift pulled me deeper into the site than I planned, the writing has a way of holding attention without resorting to manipulative cliffhangers or vague promises that never get delivered later down the page.

  17. Did not expect much when I clicked through but ended up reading the whole thing carefully, and a stop at dustorchid kept that engagement going, sometimes the unassuming sites turn out to deliver more than the flashy ones which is something I have learned to look out for over time online lately and across topics.

  18. SamuelGoota SamuelGoota

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

  19. A particular kind of restraint shows up in the writing, and a look at structureyourgrowth maintained the same restraint across pages, knowing what not to say is just as important as knowing what to say and this site has clearly developed strong instincts on both sides of that editorial line throughout pieces I have read.

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

  21. Loved the writing voice here, friendly without being fake and confident without being arrogant, and a stop at mintdawn carried the same tone forward, the kind of personality that makes a reader feel welcome rather than lectured at which is a balance plenty of writers struggle to find no matter how long they have been at it.

Deixe um comentário

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