Use smaller stack for crawler threads

This commit is contained in:
Pieter Wuille 2013-04-17 16:01:25 +02:00
parent 78b646d874
commit b735e5f1ff

View file

@ -397,10 +397,14 @@ int main(int argc, char **argv) {
pthread_create(&threadSeed, NULL, ThreadSeeder, NULL); pthread_create(&threadSeed, NULL, ThreadSeeder, NULL);
printf("done\n"); printf("done\n");
printf("Starting %i crawler threads...", opts.nThreads); printf("Starting %i crawler threads...", opts.nThreads);
pthread_attr_t attr_crawler;
pthread_attr_init(&attr_crawler);
pthread_attr_setstacksize(&attr_crawler, 0x20000);
for (int i=0; i<opts.nThreads; i++) { for (int i=0; i<opts.nThreads; i++) {
pthread_t thread; pthread_t thread;
pthread_create(&thread, NULL, ThreadCrawler, NULL); pthread_create(&thread, &attr_crawler, ThreadCrawler, NULL);
} }
pthread_attr_destroy(&attr_crawler);
printf("done\n"); printf("done\n");
pthread_create(&threadStats, NULL, ThreadStats, NULL); pthread_create(&threadStats, NULL, ThreadStats, NULL);
pthread_create(&threadDump, NULL, ThreadDumper, NULL); pthread_create(&threadDump, NULL, ThreadDumper, NULL);