[haiku-bugs] Re: [Haiku] #5693: Implement pthread spinlocks (easy)

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sat, 17 Apr 2010 16:46:59 -0000

#5693: Implement pthread spinlocks (easy)
--------------------------+-------------------------------------------------
 Reporter:  bonefish      |       Owner:  nobody        
     Type:  enhancement   |      Status:  new           
 Priority:  normal        |   Milestone:  R1            
Component:  System/POSIX  |     Version:  R1/Development
 Keywords:                |   Blockedby:                
 Platform:  All           |    Blocking:                
--------------------------+-------------------------------------------------

Comment(by bonefish):

 Replying to [comment:2 lucian]:
 > Barrett, sorry for not posting this earlier. I've finished a generic
 implementation, and am working on making platform dependent
 implementations.

  - I don't see much value in platform specific implementations.
  - pthread_spin_lock()/pthread_spin_trylock(): The {{{slock->lock ==
 SLOCKED}}} check is superfluous. It just adds overhead in the likely case
 that the lock in not locked (spinlock are usually chosen when low lock
 contention is expected).
  - The coding style encourages readable identifiers: I.e. either
 LOCKED/UNLOCKED or SPINLOCK_LOCKED/SPINLOCK_UNLOCKED.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5693#comment:3>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: