Re: [gnome-db] libgda and threads



Hi Vivien,


Vivien Malerba wrote:
> 2008/7/30 Massimo Cora' <maxcvs email it>:
> 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).

I suppose the lock is done automatically because I don't see any
gda_connection_lock () into gda-connection.h, which is a great thing.

> 
> 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.
> 

I tried to remove my GMutex locks/unlocks and it seems to work properly
now, without threading problems. I have to check it further anyway to be
100% sure it really works.

I got a crash with revision 3186, after a gda connection is used and
some prepared statements are compiled inside it:

** Message: SymbolDBPlugin: Dectivating SymbolDBPlugin plugin ...
**
** ERROR:(gda-connection.c:3691):statement_weak_notify_cb: assertion
failed: (cnc->priv->prepared_stmts)

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb6d136c0 (LWP 5743)]
0xb6d76c66 in raise () from /lib/libc.so.6
(gdb) bt
#0  0xb6d76c66 in raise () from /lib/libc.so.6
#1  0xb6d78571 in abort () from /lib/libc.so.6
#2  0xb6ef6f69 in g_assertion_message () from /usr//lib/libglib-2.0.so.0
#3  0x0a5c1790 in ?? ()
#4  0x00000000 in ?? ()


thanks and regards,
Massimo


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