emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x-display-pixel-width/height inconsistency


From: Eli Zaretskii
Subject: Re: x-display-pixel-width/height inconsistency
Date: Fri, 10 May 2013 11:41:38 +0300

> Date: Fri, 10 May 2013 16:47:36 +0900
> From: YAMAMOTO Mitsuharu <address@hidden>
> Cc: address@hidden
> 
> Even if the callback is called in another thread (though I don't think
> there is a particular reason to do so), that is indistinguishable for
> Fcons from the call in the same thread if memory is properly
> synchronized before the call among different processors/cores.

We don't know if this is the case, and probably never will.  (I tried
to search the net for any additional information about this API, but
came up empty-handed.)

> If not properly synchronized, use of other data structures such as a
> simple linked list does not solve the problem either (you can't even
> count the number of monitors without explicit synchronization by
> mutex).

You can count monitors with EnumDisplayMonitors if you pass to the
callback a pointer to a static int variable, which the callback will
increment.  You can then allocate an array of a suitable size and call
EnumDisplayMonitors again, this time filling the array with HMONITOR
handles, one at a time.  This makes sure we don't cons and don't
otherwise allocate memory inside a callback.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]