Hello everyone,
I just found that copperspice makes direct calls to the POSIX pthreads functions (in the unix version). Why is that? I thought that copperspice was supposed to be using modern C++ which comes with all the synchronization primitives needed and in a portable way. I hope someone can explain why this is please?
Why does copperspice use POSIX threads instead of C++11 and beyond
Re: Why does copperspice use POSIX threads instead of C++11 and beyond
Yes, CopperSpice does currently use POSIX pthreads which do work properly. There are more modern ways to implement this functionality, however using POSIX has no barring on the fact that CopperSpice does use modern C+17 and a recent release of CMake.copperspice makes direct calls to the POSIX pthreads functions
It is on our road map to replace this with std::thread. There are however other items which have a high priority right now. If this is something you would like to work on and submit a pull request we would be more than happy to accept this.
Barbara
Re: Why does copperspice use POSIX threads instead of C++11 and beyond
I will have to decline. I have taken a look over this weekend and IMO it would be a tonne of work. It has been a long while since I did POSIX threads programming and I never used that part with keys that I think gives you TLS, so I wouldn't know how to map it to thread_local. Plus there is a big difference in the copperspice code between the threading and synchronization primitives with unix versus windows. Most of the unix stuff I understand but not the windows stuff. So I'm sorry, but I can't help.