[fpc-pascal] Implementing a true Singleton - Can we decrease thevisibility of a method?

Matt Emson memsom at interalpha.co.uk
Mon Dec 11 10:39:48 CET 2006


> I use singletons in the following cases.

The problem with using singletons in this way is that they're not [very]
thread safe. You end up needing a locking mechanism that gets tiring very
quickly. I can't offer you a better solution, but I have worked on a project
where it was a real problem, and so speak from experience. If you go down
this route, you kind of force single threadedness on to your application -
which obviously might be what you desire. Retro fitting threading semantics
on to such an app is a complete nightmare though.

M




More information about the fpc-pascal mailing list