Start DNS threads first
This commit is contained in:
parent
9b9f0e89d8
commit
321b221a34
1 changed files with 11 additions and 11 deletions
22
main.cpp
22
main.cpp
|
@ -376,17 +376,6 @@ int main(int argc, char **argv) {
|
||||||
db.ResetIgnores();
|
db.ResetIgnores();
|
||||||
printf("done\n");
|
printf("done\n");
|
||||||
}
|
}
|
||||||
pthread_t threadDns, threadSeed, threadDump, threadStats;
|
|
||||||
printf("Starting seeder...");
|
|
||||||
pthread_create(&threadSeed, NULL, ThreadSeeder, NULL);
|
|
||||||
printf("done\n");
|
|
||||||
printf("Starting %i crawler threads...", opts.nThreads);
|
|
||||||
for (int i=0; i<opts.nThreads; i++) {
|
|
||||||
pthread_t thread;
|
|
||||||
pthread_create(&thread, NULL, ThreadCrawler, NULL);
|
|
||||||
}
|
|
||||||
printf("done\n");
|
|
||||||
pthread_create(&threadDump, NULL, ThreadDumper, NULL);
|
|
||||||
if (fDNS) {
|
if (fDNS) {
|
||||||
printf("Starting %i DNS threads for %s on %s (port %i)...", opts.nDnsThreads, opts.host, opts.ns, opts.nPort);
|
printf("Starting %i DNS threads for %s on %s (port %i)...", opts.nDnsThreads, opts.host, opts.ns, opts.nPort);
|
||||||
dnsThread.clear();
|
dnsThread.clear();
|
||||||
|
@ -398,6 +387,17 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
printf("done\n");
|
printf("done\n");
|
||||||
}
|
}
|
||||||
|
pthread_t threadDns, threadSeed, threadDump, threadStats;
|
||||||
|
printf("Starting seeder...");
|
||||||
|
pthread_create(&threadSeed, NULL, ThreadSeeder, NULL);
|
||||||
|
printf("done\n");
|
||||||
|
printf("Starting %i crawler threads...", opts.nThreads);
|
||||||
|
for (int i=0; i<opts.nThreads; i++) {
|
||||||
|
pthread_t thread;
|
||||||
|
pthread_create(&thread, NULL, ThreadCrawler, NULL);
|
||||||
|
}
|
||||||
|
printf("done\n");
|
||||||
|
pthread_create(&threadDump, NULL, ThreadDumper, NULL);
|
||||||
pthread_create(&threadStats, NULL, ThreadStats, NULL);
|
pthread_create(&threadStats, NULL, ThreadStats, NULL);
|
||||||
void* res;
|
void* res;
|
||||||
pthread_join(threadDump, &res);
|
pthread_join(threadDump, &res);
|
||||||
|
|
Loading…
Reference in a new issue