bug-gnulib
[Top][All Lists]
Advanced

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

gnulib: cond & spinlocks


From: Sam Steingold
Subject: gnulib: cond & spinlocks
Date: Mon, 17 Nov 2008 16:09:51 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080506)

Bruno,
would it be possible to make gnulib cond allocate on stack?
would it be possible to use fast clisp spinlocks in gnulib lock?
Thanks.

Vladimir Tzankov wrote:
On Nov 17, 2008, at 9:28 PM, Sam Steingold wrote:
I plan to create the thread2 branch after I switch to gnulib
threadlib/lock/cond to get solaris and win32 "for free".

Not real objections - but few concerns.

The xmutex_t should be recursive (for consistency - critical section on Win32 are recursive - and gnulib uses them as well).

The cond implementation in gnulib uses malloc() while the current clisp implementation uses the stack. In a long running process this may cause unexpected behavior. Also this is especially true for SPVW_PURE - where the malloc-ed areas can easily mix with the lisp heap (looks to me).

I just looked on the gnulib and do not see "realy fast" spinlocks (may be I am wrong - have not looked too hard). In the current clisp spinlocks are inlined assembly instructions. Every heap allocation is guarded with a spinlock - so any overhead may cause significant decrease in performance.


SAm.




reply via email to

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