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
While casually browsing online shops, I discovered check items here and it felt clean and simple – Good variety available and everything looks arranged in a clear way, making everything smooth, easy, and enjoyable to explore.
During random browsing I stumbled upon a site that felt polished and modern with clear structure and easy usability silver dune shop hub – The site feels modern and easy to navigate for new users, making exploration simple and straightforward from the start.
People evaluating online systems often focus on usability, modern appearance, and how smoothly the interface supports easy browsing across all sections WaveUltra Clean Portal – The UltraWave platform looks clean and modern, with browsing that feels smooth and easy thanks to its simple and intuitive structure.
As I navigated through different sections and observed the design, I noticed that visit here aligns with a structured interface – everything feels smooth, and the content is easy to browse and understand.
While exploring new online shopping interfaces for research I found visit UrbanPick Corner platform – Everything appeared neatly arranged and easy to follow, and the navigation system worked in a way that allowed quick movement between sections without losing context or clarity at any moment
During my initial visit and quick exploration of the site, I came across this helpful link which gave a good impression – clean website overall, and it feels modern and easy to browse around today.
Many people exploring digital creativity tools enjoy interactive environments that encourage learning, idea sharing, and structured inspiration discovery frostspire knowledge idea hub – The idea suggests a collaborative learning space where creativity and education merge into a seamless interactive experience.