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

5.710 Comentários

  1. Случается, когда уже не до раздумий — человек в запое , а везти в клинику просто нереально . Я через это прошел пару лет назад . Руки опускаются, а время идет. Хватаешься за телефон , а в ответ одни отговорки. Пока кто-то не посоветовал один реально работающий вариант. Если нужна немедленная консультация — а ехать куда-то нет никакой возможности , то выход один . Речь про круглосуточный выезд нарколога. В Москве , кстати , тоже полно шарлатанов, которые тянут бабло . Вся проверенная информация вот тут : частный нарколог на дом телефон частный нарколог на дом телефон Откровенно говоря, после того как прочитал , понял, как действовать правильно. Там и про капельницы расписано , и про последующее кодирование. Плюс анонимность — это важно . Рекомендую не ждать чуда.

  2. Been burned enough times to write a book on this nonsense. You spot a sweet deal online: shiny Mercedes, low daily rate, looks perfect. Completely different car waiting for you, check engine light on, and that “low rate”? Doesn’t include the mandatory insurance they somehow forgot to mention. Seven years in South Florida and I still almost fall for these tricks. When you’re searching for a legit and reliable premium ride to cruise around, avoid the airport like the plague. Anyone who’s taken the Metro here knows the struggle about this city, whether you are doing Brickell happy hour, Bal Harbour shopping, or a spontaneous drive down to the Keys.

    I’ve tried maybe 40 rental companies across Dade, Broward, and Palm Beach, but I eventually found a service with no games, no bait-and-switch, and no hidden asterisks in paragraph 8. If you are looking for the only straight shooter for premium rides across South Florida, check the current details here: exotic car rental near me exotic car rental near me. Yeah, parking in Brickell will cost you a nice steak dinner — but that’s just Miami life. Anyway, glad there’s at least one honest rental joint left in this town, let me know if you guys have any other clean spots.

  3. Вот такая история — родственник в запое , а что делать — просто тупик. Моя семья столкнулась лично . Многие думают, что само пройдет , но нет . Требуется профессиональная медицина. Перерыл весь интернет — сплошной развод . А потом наткнулся на один действительно рабочий вариант. Нужна анонимное лечение алкоголиков — не рискуй здоровьем близкого. У нас в Воронеже, кстати , тоже полно левых контор без лицензии. Реальные контакты ниже по ссылке: лечение алкоголизма в воронеже лечение алкоголизма в воронеже Честно скажу , после того как ознакомился, многое прояснилось . Там и про вывод из запоя , и про реабилитацию . И цены адекватные. Советую не тянуть .

  4. Вот такая история — человек пропадает , а что делать — непонятно . Моя семья столкнулась лично . Многие думают, что само пройдет , но нет . Нужна реальная помощь . Обзвонил десяток контор — сплошной развод . Пока не нашел один нормальный вариант. Нужна лечение наркомании в Воронеже — не рискуй здоровьем близкого. У нас в Воронеже, кстати , хватает шарлатанов . Реальные контакты ниже по ссылке: лечение алкоголизма воронеж бесплатно https://narkologicheskaya-pomoshh-voronezh-11.ru Откровенно говоря, после того как прочитал , понял свои ошибки. И про кодирование, и про реабилитацию . И цены адекватные. Советую не тянуть .

  5. Let me save you some serious time, learned this the hard way. Then you roll up to the local address to pick up the car. Plus a surprise $3000 hold on your credit card for two weeks right before giving you the keys. Nine years in South Florida and these clowns still nearly fool me. When you’re hunting for a legit and reliable premium ride to cruise around, do some real digging first and read actual customer reviews. Miami without proper wheels is basically a nightmare, especially since the AC must freeze your teeth and unlimited miles or no deal.

    I’ve tested maybe 50 rental outfits across Dade, Broward, and Collier, until I finally found one company that doesn’t play stupid games. If you are looking for the only trustworthy source for premium rides across South Florida, check the current details here: luxury car rental miami luxury car rental miami. Also, definitely bring polarized shades unless you enjoy driving blind into the sunset every single night. Just drive safe out there and definitely skip that “emergency roadside” upsell — complete waste of money. let me know if you guys have any other clean spots.

  6. Let me save you some serious pain with this Miami rental nonsense. Then you actually show up to the local office to grab the keys. Plus they put a surprise $4000 hold on your card and say it’ll take two weeks to release right before giving you the keys. Eleven years in South Florida and these clowns still almost get me. When you’re searching for a legit and reliable premium ride to cruise around, do some real digging first and read actual customer reviews. Miami without proper wheels is basically a disaster, whether you are doing Key Biscayne sunset, Design District shopping, or a spontaneous drive down to the Everglades.

    I’ve tested maybe 60 rental companies across Dade, Broward, and Collier, until I finally found one outfit that actually delivers what’s in the photos. If you are looking for the only honest source for premium rides across South Florida, check the current details here: premium car rental in miami premium car rental in miami. Yeah, parking in South Beach will cost you a nice bottle of champagne — but that’s the Miami tax. Just drive safe out there and definitely skip that “tire and wheel” upsell — pure profit for them, zero value for you. hope this helps some of you save a few bucks.

Deixe um comentário

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