Subject Re: [IBO] How make thread safe?
Author a_kassasys
--- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@m...> wrote:
> > --- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
> > > > How I can check, that I use a client DLL (gds32.dll) in thread
> > safe?
> > > > If not in thread-safe, how make in safe-mode?
> > > >
> > > > I try sample in Samples, but these examples do not work, the
> > > > application is blocked (freezes) nothing also occurs: (
> > > >
> > > > Is it mean, non-safe thread?
> > > >
> > >
> > > the client library is not thread safe. You need a separate
> > connection for
> > > each thread to make it safe. Or you need to ensure that no 2
> > threads use the
> > > same connection simultaneously
> >
> > Each thread have
> > IB_Session:TIB_Session;
> > IB_Connection: TIB_Connection;
> > Transaction: TIB_Transaction;
> > FIB_Script: TIB_Script;
> > FQuery: TIB_Query;
> >
> > and making diffrent connection
> > if I make only one thread - all working,
> > if use 2 or more threads - server freezes :(
> >
>
> somethig is wrong here - there's no reason for the server to
freeze - you'll
> have to look more closely at your code.
> I assume you manually create these components inside each thread...
you
> don't rely on components on a form.. the VCL is not completely
thread safe
> either. If they are on a form, they are being created oustide the
thread.

I did upload, see Files:
sample_multi_Threads_error.zip
descr "standart sample multi Threads- safe mode?"

all into datamodule, but try it self.