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

not all jobs complete if not resumed #1

Open
chenhu66 opened this issue Sep 1, 2018 · 0 comments
Open

not all jobs complete if not resumed #1

chenhu66 opened this issue Sep 1, 2018 · 0 comments

Comments

@chenhu66
Copy link

chenhu66 commented Sep 1, 2018

Hi subhranil,

i tried several on github, yours is sofar the best. But still an issue:
if not resumed, only a couple of jobs are done, not all;
if resumed, i got a warning: [THREADPOOL:RESM:WARNING] Pool is not suspended!
Following my main.c for reference:

void longJob(void *dummy){
volatile unsigned long long i;
// for (i = 0; i < 1000000000ULL; ++i);
printf("job done\n");
}

int main(){
uint64_t size=11;
ThreadPool *pool = createPool(size);

size=20;
for(int i = 0;i < size;i++)
	addJobToPool(pool, &longJob, NULL);

resumePool(pool);

waitToComplete(pool);
printf("all jobs completed\n");
destroyPool(pool);
printf("pool destroyed\n");

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant