Hello drh,

Could you perhaps give us the rational for using TLS? How is it that
TLS is needed on cases where you run out of memory? By using TLS
you're essentially making SQlite thread aware where I'd prefer it to
know nothing about thread contexts or whether it's running in a thread
or not. How is TLS better than a simple malloc and free in this
instance?

To me the proper solution would be to avoid using TLS in the first
place since, you (sqlite) neither create nor destroy the thread.

C


Wednesday, January 11, 2006, 10:00:02 AM, you wrote:

dhc> In the unix world using pthreads, when you allocate
dhc> thread-local storage, you specify a callback function
dhc> to delete the storage when the thread terminates.
dhc> This callback is the second argument to
dhc> pthread_key_create(),  See, for example,

dhc>   http://www.mkssoftware.com/docs/man3/pthread_key_create.3.asp

dhc> Question:  How do you do the same thing on windows?
dhc> How do you get a thread to clean up its thread-local-storage
dhc> obtained using TlsAlloc() and TlsSetValue() when the
dhc> thread terminates?

dhc> I need an answer to this question so that I can fix
dhc> ticket #1601:  http://www.sqlite.org/cvstrac/tktview?tn=1601

dhc> --
dhc> D. Richard Hipp <[EMAIL PROTECTED]>




-- 
Best regards,
 Teg                            mailto:[EMAIL PROTECTED]

Reply via email to