yonicswe / cynet

0 stars 0 forks source link

Library for threads #11

Open ASmoliak opened 2 years ago

ASmoliak commented 2 years ago

pthreads can be so ugly, in C++ you can use std::thread (since C++11, which it seems you are using right now) It offers a more object-oriented interface, and handles creating/freeing the thread for you, and is portable to other platforms, allowing for easier cross-platform development.

While it isn't doesn't give you all of the functionality of pthreads, you can grab the underlying pthread handle from it, and call your usual pthread functions on it. Try to replace pthread with std::thread

yonicswe commented 2 years ago

done