ARM-software/progress64

[Q] p64_spinlock usage

Closed this issue · 6 comments

Hello, developers.

I have a question about Progress64.
Do p64_spinlock functions equal the following pthread functions?

PROGRESS64 Pthread Spinlock
p64_spinlock_init pthread_spin_init
pthread_spin_destroy
p64_spinlock_acquire pthread_spin_lock
p64_spinlock_try_acquire pthread_spin_trylock
p64_spinlock_release pthread_spin_unlock

I'm tyring to use this librarin in OpenUCX

Best regards.

Sorry for late answer.
Yes I this is a correct mapping.
Some of the Progress64 lock implementations have a fini call as well (that would correspond to destroy) but this is not required for the basic spin lock.
Depending on e.g. contention level, other lock designs are potentially better (e.g. scales better) than the basic spin lock.

Hello, @WonderfulVoid
Thank you for your reply. Sorry for the late reply.

The spinlock test of p64_spinlock implementation failed in OpenUCX.
I need to investigate it. I need to learn to debug techniques.

I'll appreciate if you tell me how to debug it.
I would like to know when a thread gets a lock and release it.

How does it fail?

Hello, @WonderfulVoid

I'll update detail later. Please wait.
But I'm wondering it OpenUCX specific issue.
I suspected incorrect progres64 use first.
But It seems correct usage. So I asked about debug tactics.

Add printf's to the different p64_spinlock functions? Run in a debugger with breakpoints on the different spinlock functions?
Really difficult to suggest debug tactics when I have absolutely no clue what is going wrong.

Hello, @WonderfulVoid

I'm not investigating detail the error yet.
(I just executed make -C test/gtest test)

  • In pthread_spinlock (original code) : passed
  • p64 spinlock version : test failed. (I can't breakdown what test failed yet.)

I'll add printf code to the spinlock functions and watch it.
It probably the first step. I'll ask again when I get more detail and need your help.

Thank you for your advice again.