> > I have built mysql (4.0.9) on freebsd (4.7-RELEASE) with > linuxthreads > > (2.2.3) and still encounter the 'strange threading' > behavior described in J. > > Zawodny's blog. > > > > Here's the situation... > > > > 1/ there are three threads which lock and then write to two > different > > tables... > > At the same time? Each thread locks both tables and then writes? Or > something else? Can you post the exact SQL and sequence of events to > see if someone else can reproduce or explain it?
Your first thought is right...each thread locks both tables and writes. These threads are three instances of the same procedure: each thread does a 'lock tables table_a low_priority write, table_b low_priority write'; hence two waiting for the thread that presently has the locks. I've tried with two threads and four threads as well and I get the same result. > > > the locks are gotten using 'low_priority write'; the writing threads > > are continually waiting for locks (i.e two are waiting, one is > > executing); > > Hmm. > > What if you don't use low-priority write? Does it work normally then? I tried with low_priority and without low_priority--no difference. > > > 2/ On a different thread I do a select count(*) from one of > the tables; > > > > Sometimes the select returns pretty quick witht the count; however, > > frequently the selecting thread will simply hang waiting to > get the lock--if > > I look at the thread in [top] the thread will be taking a > LOT of cpu time; > > if I look at the offending thread in the processlist it has > a cycling status > > of > > 'waiting for tables', 'NULL', 'Locked', 'System Lock' and > 'Reopen Tables'. > > Any chance you can truss the pid of the process that's sucking CPU > time? We manged to find an old thread-related bug on FreeBSD/MySQL > that way a year or so back. Actually I can kill off the process from within Mysql--it's not really frozen, it simply is thrashing through the aforementioned status over and over without ever getting its lock. I have observed this behavior with Mysql and Linuxthreads, as well as with native threads on FreeBSD--haven't tried on Linux. FWIW, I tried doing the count(*) on 'table_a' both as a single sql statement, and bracketed by lock tables/unlock tables. Also FWIW, one of the tables that is being locked has a blob column in it. Regards, Peter <^_^> --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php