This is the mail archive of the
mailing list for the glibc project.
Re: Support for i386 builds of glibc?
On Mon, 4 Mar 2013, David Miller wrote:
> > I think "can't" is too strong a statement, signals are to userland what
> > interrupts are to the kernel. The whole critical section could run with
> > all signals blocked; if you wrote that the overhead might be prohibitive,
> > then I would agree though.
> You can't mess with signal state in the lock handlers, think about
> siglongjmp and friends.
> It's impossible even if you're willing to accept prohibitive cost.
I don't believe it. Can you provide me with an example where a sequence
while (!take_spinlock (&cmpxchg_lock))
result = do_cmpxchg_manually (atomic_var, value);
would not work as a (slow) replacement for:
result = do_cmpxchg (atomic_var, value);
where the latter statement is really a single machine instruction (CMPXCHG
with atomic_var and value/result as its arguments)?
I fail to see where siglongjmp or friends could come into picture here,
the single CMPXCHG instruction being replaced has nothing to do with them
and the state of the signal mask remains unchanged outside either