简体   繁体   中英

Synchronization without PThreads

In C programming…

Are there any libraries out there that parallelizes and synchronizes code without using POSIX threads?

I've heard of OpenMP. But after checking the symbols table of a hello world implementation, I observe OpenMP is just a library built on PThreads.

EDIT
See my comment under @tmyklebu's answer

I guess my question is "why do you want to avoid pthreads?" pthreads give you a sane and portable interface to the kernel's threading and synchronisation primitives.

With that said, it's often useful to use your platform's native atomic builtins (cmpxchg or LL/SC or what have you) directly, since there is sometimes no reason for the kernel to be involved in your synchronisation.

On Linux, check out the futex system call.

Intel releases this "Threading Building Blocks" thing. AMD has something similar. I've hardly used either so I won't try to comment on them.

MPI is a thing, too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM