Andreas
Andreas

Reputation: 5301

How does XLockDisplay() work across multiple processes?

I'm dealing with multiple processes that read eachothers's drawables and thus need synchronization. XLockDisplay is supposed to "lock out all other threads" from using the display, but does that apply across multiple processes?

Also, do all processes need to call XInitThreads or just the one(s) calling XLockDisplay?

Upvotes: 0

Views: 471

Answers (1)

Valery S.
Valery S.

Reputation: 636

XLockDisplay func (and LockDisplay macros) has to be used inside the same XClient app, ie process... They make no sense btw XClients (so btw 2 processes). This is a way to protect against multiple threads (so inside the same process) attempting to access the same X connection (eg see GLX-1.4, ch. 2.7)

In order to read the whole content (buffer) of another window, you could take a look at any app that makes a screenshot from your desktop or from a single window (see 'scrot' source code for example).

If you want to exchange data btw XClients, use their Properties/Atoms (see XLib ICCC).

Upvotes: 1

Related Questions