Skip to contentSkip to conversation

Problem with threads..

parisc-linux Christian Suder 3 participants 8 messages Dec 29, 2001 – Dec 31, 2001

lore
Share & tools
lore
#0 lore raw

Hello,

the pan newsreader does not want to work on parisc platforms (neither the ones from the debian archive nor a version compiled from scratch). Digging a little bit I found the application hangs at pthread_mutex_lock and similar calls. Tried with various kernel versions over the last couple of months, never worked. Known issue ?

Thanks,
Christian

#1 lore raw
Quoted 3 lines · Christian Suder

Hello,

the pan newsreader does not want to work on parisc platforms (neither the ones from the debian archive nor a version compiled from scratch). Digging a little bit I found the application hangs at pthread_mutex_lock and similar calls. Tried with various kernel versions over the last couple of months, never worked. Known issue ?

I can confirm the problem here on my 712/60. DirectFB (www.directfb.org) does not work either and hangs during first pthread_mutex_lock().

andi

#2 lore raw
In reply to Christian Suder
Quoted 2 lines

the pan newsreader does not want to work on parisc platforms (neither the ones from the debian archive nor a version compiled from scratch). Digging a little bit I found the application hangs at pthread_mutex_lock and similar calls. Tried with various kernel versions over the last couple of months, never worked. Known issue ?

fwiw, what i've seen elsewhere is that on palinux, you have to make sure the mutex is initialized before locking works. on other platforms sometimes you can get away with doing a lock without a mutex init.

for another example see http://bugs.debian.org/124307

randolph

Signature · 4 lines
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^
#3 lore raw
Quoted 1 line · On Sat, 29 Dec 2001 22:44:47 -0800 "Randolph Chung" <[email protected]> wrote:
Quoted 1 line

the pan newsreader does not want to work on parisc platforms (neither

the ones from the debian archive nor a version compiled from scratch). Digging a little bit I found the application hangs at pthread_mutex_lock and similar calls. Tried with various kernel versions over the last couple of months, never worked. Known issue ?> >

Quoted 4 lines

fwiw, what i've seen elsewhere is that on palinux, you have to make sure the mutex is initialized before locking works. on other platforms sometimes you can get away with doing a lock without a mutex init.

Yes !!! There was one of 4 mutex not initialized, added that one and now it works.

Many thanks,

Christian

#4 lore raw
Quoted 6 lines
Quoted 3 lines

fwiw, what i've seen elsewhere is that on palinux, you have to make sure the mutex is initialized before locking works. on other platforms sometimes you can get away with doing a lock without a mutex init.

Yes !!! There was one of 4 mutex not initialized, added that one and now it works.

Please follow the instructions at http://www.debian.org/Bugs/Reporting
and file a bug, and let the maintainer know what you changed to get pan to work.

thanks!
randolph

Signature · 4 lines
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^
#5 lore raw
In reply to Christian Suder
Quoted 6 lines
Quoted 3 lines

fwiw, what i've seen elsewhere is that on palinux, you have to make sure the mutex is initialized before locking works. on other platforms sometimes you can get away with doing a lock without a mutex init.

Yes !!! There was one of 4 mutex not initialized, added that one and now it works.

Just to clarify...

hppa is the only platform supported by linuxthreads right now where we initialize the mutex variable to 1 so that we can do locking using ldcw. On other platforms, locks are initialized to 0 and locking is done using things like test-and-set.

In general, you always need to call pthread_mutex_init for mutexes to work. In the case of pan, the mutex variable is declared static, so it is automatically initialized to 0.

randolph

Signature · 4 lines
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^
#6 lore raw
Quoted 10 lines

Just to clarify...

hppa is the only platform supported by linuxthreads right now where we initialize the mutex variable to 1 so that we can do locking using ldcw. On other platforms, locks are initialized to 0 and locking is done using things like test-and-set.

In general, you always need to call pthread_mutex_init for mutexes to work. In the case of pan, the mutex variable is declared static, so it is automatically initialized to 0.

does that mean using the PTHREAD_MUTEX_INITIALIZER as defined in phread.h (which DirectFB does) does not work on parisc, and we _have_ to call pthreas_mutex_init()? Why does PTHREAD_MUTEX_INITIALIZER exist then?

#define PTHREAD_MUTEX_INITIALIZER \
{0, 0, 0, PTHREAD_MUTEX_TIMED_NP, __LOCK_INITIALIZER}

andi

#7 lore raw
Quoted 4 lines

does that mean using the PTHREAD_MUTEX_INITIALIZER as defined in phread.h (which DirectFB does) does not work on parisc, and we _have_ to call pthreas_mutex_init()? Why does PTHREAD_MUTEX_INITIALIZER exist then?

that works too....

randolph

Signature · 4 lines
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^