Lock requests queued?
Posted in 2012
Topics: Transactions, Locking & Isolation, Platform-Specific Issues, Versions, Editions & End-of-Life
To serialize some kind of data modifications our application uses an exclusive table lock (lock table %s in exclusive mode). Process retrieves some data, then acquires the lock and does the modifications. Then work is committed and with that the lock is released. After process 1 has acquired the lock at time t1, other processes might come and require the lock. Lets say process 2 at t2 and process 3 at t3. Is it guaranteed, that the process 2 will be the next to get the lock because it was first who tried to get it, so waiting for the longest time? Or maybe better: are the lock requests queued? Or is it more or less random, depending which of the Informix processes/threads gets CPU time? (IBM Informix version 11.5 and greater on Windows and Solaris SPARC).
As far as I know, acquisition of the lock is a free-for-all. Whichever sessions happen to have a running CPU VP slice in a VP that is active on the physical processor core will jump at the lock. It appears random. There is no priority queue. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Jun 19, 2012 at 3:25 AM, Frank Langelage <frank@lafr.de> wrote: > To serialize some kind of data modifications our application uses an > exclusive table lock (lock table %s in exclusive mode). > Process retrieves some data, then acquires the lock and does the > modifications. Then work is committed and with that the lock is released. > After process 1 has acquired the lock at time t1, other processes might > come and require the lock. Lets say process 2 at t2 and process 3 at t3. > Is it guaranteed, that the process 2 will be the next to get the lock > because it was first who tried to get it, so waiting for the longest > time? Or maybe better: are the lock requests queued? > Or is it more or less random, depending which of the Informix > processes/threads gets CPU time? > > (IBM Informix version 11.5 and greater on Windows and Solaris SPARC). > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list >
What sequencing problem are you trying to solve by this method? Perhaps the community has other ideas for you. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Jun 19, 2012 at 3:25 AM, Frank Langelage <frank@lafr.de> wrote: > To serialize some kind of data modifications our application uses an > exclusive table lock (lock table %s in exclusive mode). > Process retrieves some data, then acquires the lock and does the > modifications. Then work is committed and with that the lock is released. > After process 1 has acquired the lock at time t1, other processes might > come and require the lock. Lets say process 2 at t2 and process 3 at t3. > Is it guaranteed, that the process 2 will be the next to get the lock > because it was first who tried to get it, so waiting for the longest > time? Or maybe better: are the lock requests queued? > Or is it more or less random, depending which of the Informix > processes/threads gets CPU time? > > (IBM Informix version 11.5 and greater on Windows and Solaris SPARC). > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list >