Ir ao conteúdo

Exercicio 3 – Sistemas Operacionais II – INE5424 – UFSC

Trabalho 3 – EPOS
System Object Destruction

    No exercício três deviamos implementar o controle de destrução de objetos, o qual não deve corromper o sistema e também deve estar de acordo com a semântica da linguagem de programação.
    A implementação adotada funciona da seguinte maneira: na class Thread foi adicionado um campo _container, nele é guardada a fila em que a Thread se encontra no momento. Os métodos desta classe foram alterados para que a consistência do campo _container seja mantida. No método join, por exemplo, o campo _container é atualizado com o endereço da fila _waiting_for_me do objeto em que se da join.
    Quando uma thread entra para o estado RUNNING o seu campo container não é atualizado, já que caso o mesmo seja deletado (ou auto-deletado), ele tentará se remover de uma fila em que não está, não causando mais problemas.
    Quando uma thread que possui elementos na sua fila _waiting_for_me é deletada, ela não acorda aquelas que a estão esperando, entrando em uma situação de deadlock. Nosso sistema, por conseguir detectar essa situação facilmente, gera um aviso. Porém, caso a Thread que tente se dar join já tiver sido destruída e removida da memória, a thread em execução trava, como nosso sistema não consegue detectar esse erro ele não é informado.
    Quando um objeto que extende a classe Synchronizer é deletado, seu destrutor chama wakeup_all, fazendo com que todos as threads que estiverem travadas nele continuem a execução.

Arquivos Modificados:
Thread.h
Thread.cc
Sycronizer.h

3.120 Comentários

  1. During exploration of inspiration and lifestyle improvement websites, I found New Horizons Lifestyle Hub naturally included in the article – Found hobbies I never considered before, and it has made life feel richer, more open, and far more rewarding than before

  2. A change in perspective can completely alter how someone feels about waking up and starting daily responsibilities New Dawn Hub I used to hate mornings, but now I wake up excited and surprisingly optimistic about the day ahead – Used to hate mornings, now I wake up excited somehow

  3. JeffryBleal JeffryBleal

    Терапевтический процесс в стационаре строится по принципу последовательного выполнения клинических задач: диагностика, стабилизация, медикаментозная терапия и подготовка к амбулаторному этапу. При поступлении врач проводит детальный осмотр, собирает анамнез, оценивает неврологический статус и при необходимости назначает лабораторные исследования. На основе полученных данных формируется индивидуальный протокол, учитывающий возраст, длительность интоксикации, наличие сопутствующих патологий и переносимость лекарственных компонентов. Мы применяем только сертифицированные препараты, зарегистрированные в РФ, и строго соблюдаем клинические рекомендации Минздрава, исключая псевдонаучные методики. Стандарты оказания медицинской помощи фиксируются во внутренних регламентах и регулярно проверяются независимыми аудиторами.
    Подробнее можно узнать тут – вывод из запоя в стационаре

  4. Users who prefer clean browsing experiences often search for stores that avoid unnecessary marketing noise and present only useful and relevant deals clearly Clear Deal Hub – no fluff, just good deals that matched exactly what I needed right now, making everything feel simple, direct, and easy to complete without hesitation

  5. After analyzing multiple productivity and goal-setting platforms online, I found a webpage that naturally positioned Rapid growth portal inside its informational layout, and it contributed to a smooth, readable, and well-paced experience throughout different sections of the site

  6. NathanRix NathanRix

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

  7. Jesuscob Jesuscob

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

  8. While browsing gratitude inspired platforms and mental wellness websites, I came across Every Moment Value Network embedded within the content flow – Makes me appreciate small things, mindset shift is real, and it has helped me build a more positive and attentive approach to daily life experiences

  9. During my online browsing session this morning, I checked multiple websites before discovering quality dusk floral corner, and I found the browsing really smooth, with categories that appeared organized and a website that felt genuinely user friendly.

  10. Users who are tired of inflated pricing structures often appreciate stores that focus on clarity and fairness, where what you see feels like what you actually get without hidden adjustments Honest Pricing Hub – The name fits perfectly since it really feels like pure value, with no weird markup tricks or confusing pricing games happening anywhere

  11. During a casual exploration of simple lifestyle websites, I came across modern living store – Everything looked organized neatly and the website felt comfortable to browse, making the overall experience smooth, easy, and pleasant today.

  12. Stanleysmick Stanleysmick

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

  13. While exploring online deal hunting websites and savings-oriented shopping platforms, I discovered Amazing Savings Corner Hub embedded within the content flow – There are steals everywhere here, and my wallet is happy because I keep finding offers that make shopping feel rewarding without putting pressure on my budget at all

  14. People who improve their mindset often notice that even their sleep and waking patterns begin to feel more natural and positive Daily Renewal Space I used to hate mornings, but now I wake up feeling refreshed and genuinely happy to start the day – Used to hate mornings, now I wake up excited somehow

  15. While searching for online discovery and informational websites, I discovered daily explore hub – The site offers interesting content with engaging presentation and easy browsing flow, making navigation fast, smooth, and enjoyable across all sections.

  16. After comparing several ecommerce websites with difficult layouts and excessive promotions, I eventually spent time browsing featured shopping choices because the design looked cleaner and the categories felt easier to understand online – The site appeared well maintained throughout and the comfortable browsing experience made another future visit feel very possible.

Deixe um comentário

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