mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-05-14 14:02:46 +00:00
20k worker stacks should be enough
This commit is contained in:
parent
bc19497f88
commit
68bb8c369c
1 changed files with 20 additions and 2 deletions
22
main.c
22
main.c
|
@ -687,18 +687,36 @@ int main(int argc,char **argv)
|
|||
VEC_ZERO(tstats);
|
||||
#endif
|
||||
|
||||
pthread_attr_t tattr,*tattrp = &tattr;
|
||||
tret = pthread_attr_init(tattrp);
|
||||
if (tret) {
|
||||
perror("pthread_attr_init");
|
||||
tattrp = 0;
|
||||
}
|
||||
else {
|
||||
tret = pthread_attr_setstacksize(tattrp,20<<10);
|
||||
if (tret)
|
||||
perror("pthread_attr_setstacksize");
|
||||
}
|
||||
|
||||
for (size_t i = 0;i < VEC_LENGTH(threads);++i) {
|
||||
void *tp = 0;
|
||||
#ifdef STATISTICS
|
||||
tp = &VEC_BUF(stats,i);
|
||||
#endif
|
||||
tret = pthread_create(&VEC_BUF(threads,i),0,fastkeygen ? dofastwork : dowork,tp);
|
||||
tret = pthread_create(&VEC_BUF(threads,i),tattrp,fastkeygen ? dofastwork : dowork,tp);
|
||||
if (tret) {
|
||||
fprintf(stderr,"error while making " FSZ "th thread: %d (%s)\n",i,tret,strerror(tret));
|
||||
fprintf(stderr,"error while making " FSZ "th thread: %s\n",i,strerror(tret));
|
||||
exit(Q_FAILTHREAD);
|
||||
}
|
||||
}
|
||||
|
||||
if (tattrp) {
|
||||
tret = pthread_attr_destroy(tattrp);
|
||||
if (tret)
|
||||
perror("pthread_attr_destroy");
|
||||
}
|
||||
|
||||
#ifdef STATISTICS
|
||||
struct timespec nowtime;
|
||||
u64 istarttime,inowtime,ireporttime = 0,elapsedoffset = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue