LWN.net Logo

Shortening the rope

Shortening the rope

Posted Apr 10, 2009 4:49 UTC (Fri) by njs (guest, #40338)
In reply to: Shortening the rope by nix
Parent article: Shortening the rope

>I'm not sure why this request even exists. Anyone know? What use is it?

Because it's how you say "perform this sequence of operations atomically". The most recent example I happen to have seen is in the XSETTINGS spec where it notes you need a server grab at one point to avoid a race condition, but just in general, X is all about multiple apps working in parallel on a bunch of shared state, and sometimes you need a locking primitive.

It's also used for various hacks (e.g. if your wm does rubber-band resizes, it'll grab the server to prevent other windows redrawing themselves over the rubber band, apps that want you to enter a password will sometimes grab the server to prevent shenanigans, ...).


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds