Linux PARISC architecture development
 help / color / mirror / Atom feed
* Re: NTPL transition
@ 2008-09-06  8:24 Petr Salinger
  2008-09-06 15:31 ` Carlos O'Donell
  2008-10-24  5:45 ` Carlos O'Donell
  0 siblings, 2 replies; 18+ messages in thread
From: Petr Salinger @ 2008-09-06  8:24 UTC (permalink / raw)
  To: debian-hppa, linux-parisc


> To be technically correct this is a "static initialized lock" using
> something like PTHREAD_MUTEX_INIT. We must version every function that
> could have had a statically initialized lock, and at the start of said
> function, check the lock words and reset as appropriate. This involves
> a) Detect parisc-lt {1,1,1,1} and convert that to {0,0,0,0} b) If the
> last word in the lock[4] is zero then do nothing. Note that with
> parisc-nptl only the first word is used for locking and it doesn't
> have to be more than int aligned.

IMHO, there is no need for versioning. Moreover it wouldn't be sufficient.

Imagine function in a shared library foo which takes as argument 
pthread_mutex_t and does usual:

 	pthread_mutex_lock()
 	do some work
 	pthread_mutex_unlock()

And a program bar, which uses foo. Inside bar is a static initialized 
lock. The foo might be (re)compiled against NPTL, while bar would be 
still compiled against LT. Therefore check_and_reset() should be called as 
long as any installed (debian) package have not been recompiled against 
NPTL. The overhead of check_and_reset() looks very small, it should be no 
problem at all. The harder part is to determine each place, where
check_and_reset() should be called. It have to be in all places,
where static initialized lock might be passed for the 1st time,
i.e. it should be in  pthread_mutex_lock(), but not in
pthread_mutex_unlock().

Petr

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2008-10-24  5:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080904114551.GA18877@tilt.dandreoli.com>
2008-09-04 14:13 ` NTPL transition Carlos O'Donell
2008-09-04 15:23   ` dann frazier
2008-09-04 15:31     ` Carlos O'Donell
2008-09-04 16:04       ` dann frazier
2008-09-04 17:29         ` Carlos O'Donell
2008-09-04 17:49           ` dann frazier
2008-09-04 17:52         ` James Bottomley
2008-09-04 23:26           ` Domenico Andreoli
2008-09-05 12:17           ` Carlos O'Donell
2008-09-05 14:07             ` James Bottomley
2008-09-05 14:20               ` Kyle McMartin
2008-09-05 14:58                 ` Carlos O'Donell
2008-09-04 23:22         ` Domenico Andreoli
2008-09-06  8:24 Petr Salinger
2008-09-06 15:31 ` Carlos O'Donell
2008-09-06 20:16   ` Petr Salinger
2008-09-06 21:36     ` Carlos O'Donell
2008-10-24  5:45 ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox