Re: [gnome-db] libgda and threads



2008/7/30 Massimo Cora' <maxcvs email it>:
> Hi Vivien,
>
> I tried your changes on libgda-trunk (3.99.4) but my multithread
> population engine locks (dead-lock probably). I use GMutex to avoid
> conflicts between connections etc. Should I remove it? (btw: I tried to
> remove the mutex but the lock persist) or should I take some steps to
> configure GdaConnection to use threads?

General note: Libgda includes a GdaLockable interface which can be
used (on objects which implement it) to lock an object to be used
across several threads. Currently only the GdaConnection and
GdaSqlParser objects implement that interface, so it is unsafe to use
any other object from multiple threads at the same time (they can be
used in a multi threaded environment, but only by one thread at a
time).

As the GdaConnection implements the GdaLockable interface, it can be
used by several threads at the same time, but there can also be some
limitations imposed by the DBMS's API actually used (for example if
the API does not support multi threading, then the GdaConnection will
lock for any thread which is not the thread it was created in). With
this regard, SQLite has changed with the 3.6.0 version which is now
included in the latest SVN trunk, so I propose you do the same tests
with the latest SVN trunk version as now connections to SQLite can be
used from multiple threads at the same time.

Cheers,

Vivien

The GMutex does not define any recursive behaviour,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]