Subject Re: [IBO] Multithread memory corruption...
Author Jason Wharton
Calin,

The TIB_Monitor was designed to work such that the activity of all thread
would register in the logs. So, I cannot put in place the change you did
that works for your given situation. What I would like to know is how to fix
whatever problem you confronted, provided that your usage of it is in
accordance with the design. I may need to clarify the instructions so that
others will be able to avoid the problem you confronted. I think it may also
be useful to suggest they do what you did if they want the behavior you put
in place.

Please let me know.

Thanks,
Jason Wharton


----- Original Message -----
From: "Calin Pirtea" <calin.pirtea@...>
To: <IBObjects@yahoogroups.com>
Sent: Sunday, October 03, 2010 6:24 AM
Subject: [IBO] Multithread memory corruption...


> Hi Jason,
>
> I'm using IBO 4.8.7 and we managed to isolate a multithreading problem in
> IB_Session.pas.
>
> Isc_* hooks are not thread safe in case they are modified. Normally they
> point directly to dll_* hooks, however if someone uses the monitor then
> these hooks are overridden to point to monitor functions which are totally
> not thread safe.
>
> Our fix was to place a threadvar declaration just above
> // Hooks for monitor interrupt to be put in.
> isc_attach_database: Tisc_attach_database;
>
> We prefer to have the monitor running only on the current thread rather
> than all threads. The monitor is still not thread safe but it can be used
> safely for one thread leaving the other threads running without
> corruption.
>
> I hope this helps,
>
> Calin Pirtea
> Communicare Development Team