Opened 8 years ago
Closed 7 years ago
#10788 closed Bugs (fixed)
GetLogicalProcessor isn't available for Windows platform less or equals to 0x0502
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | Boost 1.60.0 | Component: | thread |
Version: | Boost 1.57.0 | Severity: | Problem |
Keywords: | Cc: |
Description
I've runned into an issue while using boost 1.56.0 and boost 1.57.0 while ours software was deployed on a Windows XP SP2. When using the threading library from boost, we have found out that it was using a feature only available on Windows XP SP3 and higher.
The effect are that the software built with Boost 1.56.0 and boost 1.57.0 refuse to start even after we force the feature set of windows XP to be used by the Windows Platform SDK.
I will attach a patch as a proposed fix for future version of boost.
Attachments (1)
Change History (9)
by , 8 years ago
Attachment: | boost-1.57.0-WinXP-SP2-PhysicalConcurrency-Return0.patch added |
---|
comment:1 by , 7 years ago
Component: | threads → thread |
---|
Please, don't use the threads component but the thread one.
comment:2 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
The current code is
unsigned thread::physical_concurrency() BOOST_NOEXCEPT { #if BOOST_PLAT_WINDOWS_RUNTIME || (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) return hardware_concurrency(); #else unsigned cores = 0; DWORD size = 0; GetLogicalProcessorInformation(NULL, &size); if (ERROR_INSUFFICIENT_BUFFER != GetLastError()) return 0; std::vector<SYSTEM_LOGICAL_PROCESSOR_INFORMATION> buffer(size); if (GetLogicalProcessorInformation(&buffer.front(), &size) == FALSE) return 0; const size_t Elements = size / sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); for (size_t i = 0; i < Elements; ++i) { if (buffer[i].Relationship == RelationProcessorCore) ++cores; } return cores; #endif }
Does it works for you?
comment:4 by , 7 years ago
Type: | Bugs → Support Requests |
---|
comment:5 by , 7 years ago
Type: | Support Requests → Bugs |
---|
comment:6 by , 7 years ago
Milestone: | To Be Determined → Boost 1.60.0 |
---|
#11683 describes the history of this function and how we rolled back a fix.
I've update the develop branch.
https://github.com/boostorg/thread/commit/9a8759a3dda2c63342d55d5e97ed906826cee981
comment:7 by , 7 years ago
Please also take into account the issue with comments after preprocessor continuation for VS2010 (comment:6:ticket:10824): commit/8e1be55c6d560c44fb07cc497a3480527957576c
comment:8 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Proposed patch for boost threading