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
Maker Merchant Deals Hub – Interesting selections and intuitive design keep shopping light and enjoyable.
Growth Gear Select – Easy browsing and clear sections make locating products fast.
lanterngallery.shop – Simple layout and clear guidance make marketing strategies easier to follow.
курсы по сыроедению онлайн http://www.rawrussia.ru .
польза и вред сыроедения http://www.rawrussia.ru .
Official Malware Mart Site – Helpful details and an intuitive layout allow you to move through features with ease.
Award Atelier Featured Picks – Simple yet practical design ensures smooth navigation throughout.
Cyber Cabin Hub – Fun aesthetic and browsing the site was really straightforward.
Backlink Bazaar Official – Excellent platform for marketers aiming to improve their link strategies.
Niche Patch curated collection – Product range is strong and shipping speed was remarkable.
The Horror Hub – Great spooky designs and everything is easy to browse.
posterpalace.shop – Incredible variety of posters and the delivery was impressively fast.
Notepad Nest creative collection – Fun and cheerful stationery that makes my office feel inviting.
Parcel Pilot premium collection – Smooth and simple shipping process that takes the stress out of sending packages.
внедрение ерп 1с 1s-erp-vnedrenie.ru .
внедрение erp на предприятии внедрение erp на предприятии .
FanFriendly Select Shop – Organized sections and smooth design made shopping enjoyable.
It is appropriate time to make a few plans for the future and it’s time to be happy. I have read this submit and if I may just I wish to recommend you few attention-grabbing things or tips. Maybe you can write next articles referring to this article. I desire to read more issues about it!
FontFoundry Marketplace – Clean and intuitive layout with great font examples makes exploring enjoyable.
FormulaFoundry Select Hub – Intuitive layout and helpful descriptions make finding items fast and easy.
Go to Wish Wharf – Simple navigation and clean design make checking out products pleasant.
limited edition vault – I ended up finding some impressive items during my visit.
ultimate stream store – Everything was easy to find and the process was seamless.
shipment solutions shop – Easy to browse and the site layout is highly organized.
Shop World Shipper Online – Fast pages and clear presentation make exploring products a breeze.
secure shopping hub – Completing my order was simple and completely stress-free.
Exchange Express Hub – Fast navigation and smooth browsing made shopping a breeze today.
complete men’s fashion outlet – Everything from basics to statement pieces is easy to locate.