[IBPP-DISCUSS] Re: Thank you
IBPP is a C++ client class library for FirebirdSQL
Status: Inactive
Brought to you by:
epocman
From: Olivier M. <om...@ti...> - 2001-07-03 09:01:33
|
[ Maxim I copied thies message to the list, so everybody is aware to pay attention to that detail in multi-threaded apps. ] I will add a critical-section around the initialization/release code of the library so that other people would not suffer so easily of the same problems in multi-threaded apps. But the best thing to do will always be : initialize while application starts up, before playing multi-thread. And IBPP::Release(), which is not strictly required, when the application exits (all threads tasks are completed first). Additionally, a small security trick could be a added to IBPP. In Win32 at least (and I guess in some other way on Linux too) I could simply take note in objects of the thread ID when they are instantiated (Factory). Then any method call on the objects would check the current thread ID with the one used to create the object, if they differ, it would throw an exception, something like "thread isolation violation". The same test would occur between objects linked together. You would get that exception if you attempt to use a DB from thread 1 on a transaction created on thread 2 and so on... I would do this through conditional code, that people could choose to compile in or not, wether in debug builds or production builds. I will not do this within the coming days (surely not). So if someone has suggestions about this, take time to voice them here... Yours, -- Olivier Mascia <om...@ti...> -- On lundi 2 juillet 2001 17:16 +0800 Maxim Abrashkin <ma...@ep...> wrote: > Thank you Olivier, > > After I put initialisation (CheckVerison func ) in App constructor and > Release in destructor it working Ok! > > -- > Maxim |