>>>>> "Steven" == Steven Roussey <sroussey@stripped>
Steven> Hi all!
Steven> Since we have locking issues (i.e. some thread is locking a table used by
Steven> everyone) I wanted to make mysql use a single queue rather than separate
Steven> read and write queues. Does the following change accomplish this, and what
Steven> are some of the dangers of this change?
Steven> Change (in thr_lock.c):
Steven> #define LOCK_CMP(A,B) ((byte*) (A->lock) - (uint) ((A)->type) <
Steven> (B->lock)- (uint) ((B)->type))
Steven> #define LOCK_CMP(A,B) ((byte*) (A->lock) < (byte*) (B->lock))
No, the above will not do what you want!
The above sorts all WRITE locks in one SQL statement before READ
locks. If you don't do this, then two clients that request a write
lock on one table and a read lock on some other table may deadlock!
If you want only a single lock queue, you must change the
thr_lock() function to only use one lock list. (This is not trivial,
but not that hard)