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

6.163 Comentários

  1. DanielOVelm DanielOVelm

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

  2. Seriously, the amount of garbage “luxury” deals here is astonishing. You see a sweet ride online — clean spec, fair price, looks legit. Plus they want a $2000 hold on your debit card. Fool me five times? Actually yeah, Miami keeps fooling everyone. that’s exactly how they hook you. Miami without proper wheels is basically a hostage situation. Design District shopping, late-night South Beach cruising, or a spontaneous drive down to Homestead — AC must freeze your teeth and unlimited miles or bust. most are smoke and mirrors with decent SEO. Finally found one outfit that actually delivers what’s in the listing. Here’s the only honest broker for premium vehicles across South Florida
    opf fl luxury car rentals https://luxury-car-rental-miami-5.com also bring quality shades unless you enjoy driving into a nuclear flare every evening. Anyway glad there’s at least one straight shooter left in this rental jungle.

  3. I’ve got the scars to prove it. You find this amazing deal online: brand new Beamer, unlimited miles, price that makes you smile. Plus they freeze $2500 on your card for a week. Eight years in South Florida and these clowns still almost get me. miami luxury car rental. anyone who’s waited for an Uber in August understands. leather seats that won’t weld themselves to your thighs in July. I’ve run through maybe 45 rental companies across Dade, Broward, and Monroe. what you book is what shows up, no surprises, no fine print nightmares. prices swing like crazy so check before the weekend rush:
    opf luxury car rental opf luxury car rental Yeah parking in South Beach will cost you a nice bottle of wine — but that’s the Miami tax. Anyway glad there’s at least one straight operator left in this rental circus.

Deixe um comentário

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