Opened 5 years ago

Closed 18 months ago

#15736 closed bug (fixed)

pthread_barrier_t is not working properly

Reported by: X512 Owned by: nobody
Priority: normal Milestone: R1/beta5
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This is hrev53888.

pthread_barrier_t is causing freeze on start of OpenGL applications on multicore systems.

Disabling pthread_barrier_t in Mesa and using Mesa own implementation fixes freeze.

Attachments (1)

0001-Haiku-disable-pthread_barrier_t.patch (1.1 KB ) - added by X512 5 years ago.
Mesa patch to disable pthread_barrier_t

Download all attachments as: .zip

Change History (10)

by X512, 5 years ago

Mesa patch to disable pthread_barrier_t

comment:1 by diver, 5 years ago

Component: - GeneralSystem/POSIX

comment:3 by waddlesplash, 5 years ago

Do you have a simple testcase that shows the problem? That would be helpful here.

comment:4 by X512, 5 years ago

I don't identified exact problem yet. To reproduce problem, apply this patch to mesa, enable pthread_barrier_t and run GLTeapot. It will freeze. Freeze appear in render threads.

Last edited 5 years ago by X512 (previous) (diff)

comment:5 by waddlesplash, 5 years ago

A first step would be attaching a debugger and determining what is waiting and where/why inside libroot's pthread_barrier.cpp.

Actually, looking at that code briefly, I'm not sure why it uses the kernel mutex API directly, rather than using the user_mutex wrappers, seems a little strange. I guess because it needs to do B_USER_MUTEX_UNBLOCK_ALL?

comment:6 by X512, 5 years ago

Mesa has its own implementation of barrier that can be used as reference: https://github.com/mesa3d/mesa/blob/master/src/util/u_thread.h#L204.

Last edited 5 years ago by X512 (previous) (diff)

comment:7 by waddlesplash, 5 years ago

Well, there is https://xref.landonf.org/source/xref/haiku/src/tests/system/libroot/posix/pthread_barrier_test.cpp which seems to test the relevant functionality, so I'm not sure what else Mesa could be doing that is causing problems.

comment:8 by cocobean, 4 years ago

Last edited 20 months ago by cocobean (previous) (diff)

comment:9 by waddlesplash, 18 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: newclosed

Fixed in hrev57071.

Note: See TracTickets for help on using tickets.