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

Re: [microblaze-uclinux] pthread_mutex_[un]lock - I have a bad feeling about this



Hi Falk,

Brettschneider Falk wrote:
> meanwhile I've digged through John Williams' platform stuff concerning the
> pthreadlib and it seems I've found the bug and also can give you a bugfix
> patch for this problem. 
> 
> I found out that my seen hang of pthread_mutex_unlock() was reasoned in a
> missing MEMORY_BARRIER() in the __compare_and_swap_with_release_semantics()
> call in __pthread_alt_unlock() which is in spinlock.c line 558. That leads
> to an infinite loop there in __pthread_alt_unlock().
> I checked how __compare_and_swap_with_release_semantics() is implemented in
> the other architectures and they all do that MEMORY_BARRIER() in there. Now
> with my patch the microblaze does it as well and yippie it works now! :-)
> Both threads do blinking since hours here now. Also ps looks much better
> now. Not such strange 99% on several processes, although this maybe has
> nothing to do with the patch (?).

Great stuff, thanks!  I'll check it out and get it into the upcoming 
release of the uClinux-dist (along with a bunch of other patches I have 
pending, something to do for next week...)

Cheers,

John

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/