Dear friends,

Please  help  me  to  understand several LOCKing the same tables without
unlocking them between "LOCKs". Imagine the following code: 

LOCK TABLES t1 READ, t2 READ; 
-- some hard select queries which need that other threads do not update tables 
LOCK TABLES t1 WRITE, t2 WRITE; 
-- some easy update queries 
UNLOCK TABLES; 

Is this code equal to the following: 

LOCK TABLES t1 READ, t2 READ; 
-- some hard select queries which need that other threads do not update tables 
UNLOCK TABLES; 
-- here other threads have a moment to update these tables! 
LOCK TABLES t1 WRITE, t2 WRITE; 
-- some easy update queries 
UNLOCK TABLES; 

or  t1  and  t2 will not be unlocked even for a moment before the second
lock? 

Really,  I  don't  want  to  have  a  single  WRITE LOCK here and freeze
everything for some time, but I can't understand if here is a chance for
other threads to update tables between two lockings or not...

MySQL 4.1, myisam tables (if it is important).

Best regards,
Denis Solovyov


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to