On Wed, 2009-01-07 at 13:55 +0100, Andrew Beekhof wrote:
> On Jan 7, 2009, at 1:43 PM, Steven Dake wrote:
> 
> > Yes.
> >
> > We can make it optional and use pthread_mutex in its place if the spin
> > lock operations aren't present.
> >
> > The only reason it is used now is because it is about 4x faster then
> > mutexes in the use cases of the logsys.
> 
> Understandable
> 
> >
> >
> > I wasn't aware of the portability problems.
> >
> > Is there a method to test if spin_lock is unavailable on these
> > platforms?  I don't have any of those platforms available to test on.
> 
> I only know how to do it within the context of autoconf:
>    AC_CHECK_FUNCS(some_function_name)
> 
> Which creates a #define (set to 1 if present) formed by prefixing  
> HAVE_ to the function name (all uppercase).
> 
> I guess its possible to do other ways, but you'd want to make the  
> result persistent (retesting for every build would seem sub-optimal).
> 
> Wasn't autoconf being considered at one point?
> 

I think there is a problem now of nobody to do the work, and few people
to understand how it works once its done.

But I take patches :)

> >
> >
> > Regards
> > -steve
> >
> >
> > On Wed, 2009-01-07 at 13:36 +0100, Andrew Beekhof wrote:
> >> Hi Steve,
> >>
> >> Unfortunately the use of pthread_spin_lock by logsys makes corosync
> >> unusable/uncompilable on a number of platforms including OSX:
> >>    
> >> http://www.gnu.org/software/gnulib/manual/html_node/pthread_005fspin_005flock.html
> >>
> >> Is there an alternative you could use instead?
> >>
> >> The full gcc output follows:
> >> ==== /Users/beekhof/Development/corosync-svn/exec ===
> >> logsys.c:114: error: syntax error before 'logsys_idx_spinlock'
> >> logsys.c:114: warning: type defaults to 'int' in declaration of
> >> 'logsys_idx_spinlock'
> >> logsys.c:114: warning: data definition has no type or storage class
> >> logsys.c: In function 'records_reclaim':
> >> logsys.c:176: warning: implicit declaration of function
> >> 'pthread_spin_lock'
> >> logsys.c:205: warning: implicit declaration of function
> >> 'pthread_spin_unlock'
> >> logsys.c: In function '_logsys_rec_init':
> >> logsys.c:567: warning: implicit declaration of function
> >> 'pthread_spin_init'
> >> make[1]: *** [logsys.o] Error 1
> >> make: *** [all] Error 2
> >>
> >> _______________________________________________
> >> Openais mailing list
> >> [email protected]
> >> https://lists.linux-foundation.org/mailman/listinfo/openais
> >
> 

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to