From: Georgios P. <pet...@ya...> - 2016-09-02 12:40:56
|
Dear Donal, At least one of the TODOs (the one with the thread init) is not a pressing issue, as mysql_init() will also call mysql_thread_init(), according to the manual. I am not sure whether it is called more than one though. (I think that each new connection will call mysql_init()). In my code, the connection creation (or the connection close) is not protected by a mutex. I will try to change this and see what happens. Regards, George On 2/9/2016 14:49, Donal K. Fellows wrote: > On 02/09/2016 12:11, to...@tu... wrote: >> Given what you write, it might be some part of tdbc (perhaps the *dbc >> library?) isn't thread safe? > > The core of TDBC is thread-agnostic in the usual Tcl way; it's just > bound to an interpreter. If there is a problem, it's in the > tdbc::mysql driver package. If we look at the code: > > http://core.tcl-lang.org/tdbcmysql/artifact/47de19173a3e0d14?ln=1296-1306 > > ... I might wonder based on the comment whether there is a problem. > There might be, but I don't know the mysql client library. Once open, > I'd expect connections to be interpreter-bound; that's how all of TDBC > is designed to work. (Heh, scanning through the code overall indicates > three places with “TODO” that might indicate something relevant, but I > don't know for sure.) > > I assume that if you put the actual connection creation guarded by a > mutex, which you can do easily enough from user code via the > primitives in the Thread package (i.e., you can check without changing > or recompiling the tdbc::mysql code), everything else after that will > work as well as the DB permits. > > Donal. > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Tcl-tdbc mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-tdbc |