logoalt Hacker News

grg0today at 1:11 AM2 repliesview on HN

Why are you using pthread instead of std::thread?


Replies

pg83today at 1:20 AM

I guess I just didn't notice. In any case, it wouldn't have been std::thread, but https://github.com/pg83/std/blob/master/std/thr/thread.h from my bike lib!

show 1 reply
quotemstrtoday at 1:28 AM

One advantage to using pthread is the ability to call pthread_setname_np to name threads and thereby make debugging easier. Granted, you can call it with std::thread by using std::thread::native_handle() to get the pthread handle, but you're still using a non-std::thread API.

show 1 reply