Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only single thread is used in 'Sampler' #26

Open
kikoo321 opened this issue Sep 21, 2019 · 1 comment
Open

Only single thread is used in 'Sampler' #26

kikoo321 opened this issue Sep 21, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@kikoo321
Copy link
Contributor

AS you know.....

@cmpark0126 cmpark0126 added the bug Something isn't working label Sep 21, 2019
@cmpark0126
Copy link

cmpark0126 commented Sep 21, 2019

I think this is the problem with lambda expression code.
Please check that logic and if there is error semantically, fix them using another C/C++ function.

Refer to this code below:

template<typename DTYPE> void DataLoader<DTYPE>::StartProcess() {
// Generate thread for Dist - DistributeIdxOfData2Thread()
// Generate thread set for Process -
m_nowWorking = TRUE;
m_aThreadForDistInfo = std::thread([&]() {
this->DistributeIdxOfData2Thread();
}); // lambda expression
printf("Generate dataloader base thread\r\n");
for (int i = 0; i < m_numOfWorker; i++) {
m_aaWorkerForProcess[i] = std::thread([&]() {
this->DataPreprocess();
}); // lambda expression
printf("Generate worker[%d] for data preprocessing\r\n", i);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants