Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any user-mode multi-threading library/framework for C++ under Linux?

Tags:

c++

linux

I am looking for user-mode multi-threading library/framework for C++ under Linux. I am familiar with boost::thread and ACE_Thread_Manager but AFAIK both of them eventually use OS native thread's support.

Suggestions will be highly appreciated.

like image 779
tonymontana Avatar asked Dec 18 '22 06:12

tonymontana


2 Answers

GNU PTH: http://www.gnu.org/software/pth/

It's using cooperative multithreading, which is why it's used in GnuPG (which for security reasons doesn't want real threads, but for responsiveness reasons needs threads).

like image 75
Marc Mutz - mmutz Avatar answered Dec 19 '22 19:12

Marc Mutz - mmutz


Is MTasker the kind of thing you're looking for? It's also a cooperative multi-tasking library. You might also want to consider just whipping up some state machines.

Also check out State Threads and MIT Pthreads.

This tool will assist in the generation of hierarchical state machines, which could be used for this purpose: CHSM

like image 37
Gabe Avatar answered Dec 19 '22 19:12

Gabe