atomic section in code
Diez B. Roggisch
deets at nospam.web.de
Sun Sep 7 16:53:15 CEST 2008
Hendrik van Rooyen schrieb:
> Fredrik Lundh <fredr...ware.com> wrote:
>> sounds like he wants/needs non-cooperative, mandatory locking.
> Could one get there using ctypes to disable interrupts?
Not as such, ctypes can't execute arbitrary machine code. But of course
you can create a C-lib that does what you want (IF it can be done, that
is..), and wrap that.
> Cross Platform?
> I can think of lots of hassles, starting with permissions
> to use the privileged instructions.
I don't think there is a chance for this without major system tinkering.
Under Linux, you could create a real time thread so highly prioritized
that it won't yield any time to any other scheduler. And in a
kernel-module, you can call cli (or whatever the needed call is). But
this will most probably break your system.
More information about the Python-list