You are not logged in.
Pages: 1
I got a service server, somewhat like sample 6, using HTTP.SYS
One of the services uses an object which is slow to create so it's created when the server starts and protected with a critical section.
This works but is there a way to create one instance of this object for each thread of the server and then access it from within the server's service function?
Offline
You can either:
- use a threadvar variable;
- use ServiceContext.RunningThread property to retrieve the calling thread (and its ID);
- override TSQLRestServer.BeginCurrentThread() and TSQLRestServer.EndCurrentThread() to handle your server instance life time.
Offline
Thank you, I'll investigate the best way
Offline
Pages: 1