Use the CSD_NUMBER_ONLINE_CPUS entry to return the hardware_concurrency for MVS.
Details
Diff Detail
Event Timeline
libcxx/src/thread.cpp | ||
---|---|---|
110 | There is no named API for this on z/OS? |
libcxx/src/thread.cpp | ||
---|---|---|
110 | Unfortunately, there isn't an API for this on z/OS. |
libcxx/src/support/ibm/hardware_concurrency_zos.cpp | ||
---|---|---|
38 | Why don't you rename this to hardware_concurrency_zos() , make it static function and call it from the original place in thread.cpp? |
LGTM
libcxx/include/thread | ||
---|---|---|
275 | This could be non-member static function in ibm namespace, same as we did nonosleep().. |
libcxx/include/thread | ||
---|---|---|
275 | You have to __uglify the name. |
libcxx/include/thread | ||
---|---|---|
275 | Are you refering to hardware_concurrency_zos() or nonosleep()? Do you have any suggestion if you refer to hardware_concurrency_zos() ? |
I am extremely concerned by the need to introduce these sorts of arcane implementation details in the library for z/OS, especially since we don't have a clear idea of where these patches are going to stop.
libc++ is not a "low level system library". It's a library layered on top of C libraries and other standard (or mostly standard) APIs like POSIX and others. It's fine to have some amount of low level and platform specific stuff, but we're not going to implement from scratch APIs that should be provided by any decent OS.
libcxx/include/thread | ||
---|---|---|
274 | This can't have inline visibility if it's in the built library. | |
275 | And yeah it shouldn't be in the thread class either way. | |
libcxx/src/support/ibm/hardware_concurrency_zos.cpp | ||
1 | We don't put file names here anymore. |
Thanks for the feedback. I'll close this revision until we have an API for this on z/OS. It should be noted that it is in the works but not feasible in the short term, which is why we upstreamed this workaround in the meantime. To be more upstream friendly, we wanted to keep it in the support/ibm directory until we have an API.
This can't have inline visibility if it's in the built library.