Recently I used a Singleton Pattern in one of my projects. Find the excerpt of the constraints as below.
I had to develop a Windows service to download data from a Mainframe database for individual entities and create MS Access files from these. I had only read access to the AS400. Also if the Windows services is restarted, it needed to continue from where it left off. So, I needed a datastore to keep track of my Windows service processing.
I was specifically instructed that I could not use SQL Server and had to use a custom XML database as it was for a smaller purpose. Also the Windows service had to be multi threaded to download the AS400 data for multiple entities parallely.
Since I needed to use an XML datastore which was accessed concurrently by multiple threads, I could have only one instance of my XML file in memory at any given point of time.
Therefore, I decided to use the Singleton pattern here. In addition, we used locks and synchonizing objects within the Singleton.