Skip to content

Commit

Permalink
初始化线程数问题
Browse files Browse the repository at this point in the history
  • Loading branch information
stsm85 committed Dec 10, 2018
1 parent e7dc5ba commit 5c954be
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions PckDll/PckControlCenter/PckControlCenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "PckClassLog.h"
#include <thread>

const DWORD CPckControlCenter::m_dwNumberOfProcessors = thread::hardware_concurrency();
//const DWORD CPckControlCenter::m_dwNumberOfProcessors = thread::hardware_concurrency();

CPckControlCenter::CPckControlCenter():
m_lpClassPck(NULL),
Expand All @@ -39,7 +39,7 @@ void CPckControlCenter::init()
cParams.lpPckControlCenter = this;
cParams.code_page = 936;
cParams.dwCompressLevel = getDefaultCompressLevel();
cParams.dwMTThread = m_dwNumberOfProcessors;
cParams.dwMTThread = thread::hardware_concurrency();
cParams.dwMTMaxMemory = getMaxMemoryAllowed();

m_lpPckLog = new CPckClassLog();
Expand Down
2 changes: 0 additions & 2 deletions PckDll/PckControlCenter/PckControlCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ class EXPORT_CLASS CPckControlCenter
//格式
FMTPCK m_emunFileFormat;

const static DWORD m_dwNumberOfProcessors;

static FeedbackCallback pFeedbackCallBack;
static void* pTag;

Expand Down
10 changes: 2 additions & 8 deletions PckDll/PckControlCenter/PckControlCenterParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
//////////////////////////////////////////////////////////////////////

#include "PckControlCenter.h"


//LPPCK_RUNTIME_PARAMS CPckControlCenter::GetParams()
//{
// return &cParams;
//}

#include <thread>

#pragma region 线程控制

Expand Down Expand Up @@ -96,7 +90,7 @@ void CPckControlCenter::setMaxThread(DWORD dwThread)
//线程默认参数
DWORD CPckControlCenter::getMaxThreadUpperLimit()
{
return (m_dwNumberOfProcessors + ((m_dwNumberOfProcessors + (m_dwNumberOfProcessors & 1)) >> 1));
return (thread::hardware_concurrency() + ((thread::hardware_concurrency() + (thread::hardware_concurrency() & 1)) >> 1));
}

#pragma endregion
Expand Down
4 changes: 2 additions & 2 deletions PckDll/include/pck_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ typedef char * LPSTR;
typedef PCK_UNIFIED_FILE_ENTRY* LPPUFE;
typedef const PCK_UNIFIED_FILE_ENTRY* CLPPUFE;

#define WINPCK_VERSION "1.30.0.5"
#define WINPCK_VERSION_NUMBER 1,30,0,5
#define WINPCK_VERSION "1.30.0.6"
#define WINPCK_VERSION_NUMBER 1,30,0,6

typedef enum _PCKRTN
{
Expand Down
Binary file modified Release/WinPCK_x64.exe
Binary file not shown.
Binary file modified Release/WinPCK_x86.exe
Binary file not shown.
Binary file modified Release/pckdll_x64.dll
Binary file not shown.
Binary file modified Release/pckdll_x86.dll
Binary file not shown.
Binary file modified Release_static/WinPCK_x64.exe
Binary file not shown.
Binary file modified Release_static/WinPCK_x86.exe
Binary file not shown.

0 comments on commit 5c954be

Please sign in to comment.