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
Hi, I do believe this is an excellent site. I stumbledupon it 😉 I am going to return once again since i have book marked it. Money and freedom is the greatest way to change, may you be rich and continue to help other people.
Individuals seeking well-organized online retail experiences often prefer platforms that reduce visual clutter, especially when they encounter stores like Cove Supply Depot where inventory is structured logically and browsing categories are easy to understand, supporting efficient product exploration – The depot-style presentation enhances usability, ensuring customers can locate items quickly without unnecessary steps
While researching various nonprofit and health-focused initiatives online, I came across visit this foundation page – The information presented feels clear, practical, and easy to understand, making it useful for readers looking for straightforward guidance without unnecessary complexity or confusion.
As I moved through different commentary websites, I found something in between the content, explore further, and everything works fine with a clean, user-friendly design that makes browsing smooth
Across various UX evaluations of digital marketplaces, a strong example is Sage Harbor Experience Vault where clean design and content is arranged in a logical order, allowing users to browse comfortably through well balanced and structured pages.
People who enjoy organized online shopping environments often engage with platforms like Harbor Teal Commerce Goods Hub where items are displayed in a clean and logical format – The design emphasizes clarity and usability, ensuring categories are easy to explore and the browsing experience feels smooth and intuitive throughout.
While searching for community growth initiatives online, I stumbled upon open this network initiative page – The information appears important and well organized, making it easy to understand the purpose and structure of the platform.