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 exploring various entertainment and artist-focused websites online, I came across visit this entertainment hub page – The site feels solid overall, with a layout and information flow that work really well together, making browsing smooth and enjoyable.
While exploring online commerce platforms with minimal design I discovered a site featuring gentle shopping portal – the calming color scheme creates a smooth experience and the layout is simple and user friendly
Users who enjoy high quality ecommerce collectives often engage with platforms such as Golden Stone Collective Style Hub where branding emphasizes elegance and cohesion – The layout creates a refined shopping experience that highlights curated products in a visually consistent and aesthetically pleasing environment.
While analyzing user experience in commerce hub websites, I checked see linen meadow commerce portal – The layout feels neat and efficient, and browsing is smooth, pleasant, and easy to enjoy without any friction.
Across structured UX studies of online marketplaces, a standout example is Harbor Violet Flow House where clean structure overall, makes browsing feel smooth and simple, delivering a frictionless experience supported by consistent layout and intuitive navigation patterns.
As I compared different commerce hub platforms for usability, I came across explore linen meadow digital hub – The site feels easy to navigate, and the browsing experience is smooth, enjoyable, and well structured throughout.
preventcovid19trial-uk.com – Informational tone here, content feels research focused and medically structured layout
In the middle of exploring travel guide resources, I came across explore derry tourism page – The information is engaging and easy to browse, giving users a smooth experience when looking for travel inspiration.
nightorchardretailmart.shop – Bought a gift last week, packaging felt really premium honestly.
People who enjoy minimalist ecommerce platforms often prefer vault layouts that prioritize straightforward navigation and clean visual presentation Harbor Hazel Vault Access Point – The design emphasizes structured browsing with easy category access and consistent layout patterns ensuring users can explore products comfortably while maintaining focus on clarity and usability throughout the entire digital shopping experience today system.