Browse Source

tpws: decrease process VSZ by limiting thread stack size

pull/181/head
bol-van 1 year ago
parent
commit
a760745452
  1. BIN
      binaries/aarch64/tpws
  2. BIN
      binaries/arm/tpws
  3. BIN
      binaries/freebsd-x64/tpws
  4. BIN
      binaries/mac64/tpws
  5. BIN
      binaries/mips32r1-lsb/tpws
  6. BIN
      binaries/mips32r1-msb/tpws
  7. BIN
      binaries/mips64r2-msb/tpws
  8. BIN
      binaries/ppc/tpws
  9. BIN
      binaries/x86/tpws
  10. BIN
      binaries/x86_64/tpws
  11. BIN
      binaries/x86_64/tpws_wsl.tgz
  12. 12
      tpws/resolver.c

BIN
binaries/aarch64/tpws

Binary file not shown.

BIN
binaries/arm/tpws

Binary file not shown.

BIN
binaries/freebsd-x64/tpws

Binary file not shown.

BIN
binaries/mac64/tpws

Binary file not shown.

BIN
binaries/mips32r1-lsb/tpws

Binary file not shown.

BIN
binaries/mips32r1-msb/tpws

Binary file not shown.

BIN
binaries/mips64r2-msb/tpws

Binary file not shown.

BIN
binaries/ppc/tpws

Binary file not shown.

BIN
binaries/x86/tpws

Binary file not shown.

BIN
binaries/x86_64/tpws

Binary file not shown.

BIN
binaries/x86_64/tpws_wsl.tgz

Binary file not shown.

12
tpws/resolver.c

@ -179,14 +179,24 @@ bool resolver_init(int threads, int fd_signal_pipe)
action.sa_handler = sigbreak; action.sa_handler = sigbreak;
sigaction(SIG_BREAK, &action, NULL); sigaction(SIG_BREAK, &action, NULL);
pthread_attr_t attr;
if (pthread_attr_init(&attr)) goto ex1;
// set minimum thread stack size
if (pthread_attr_setstacksize(&attr,20480))
{
pthread_attr_destroy(&attr);
goto ex1;
}
for(t=0, resolver.threads=threads ; t<threads ; t++) for(t=0, resolver.threads=threads ; t<threads ; t++)
{ {
if (pthread_create(resolver.thread + t, NULL, resolver_thread, NULL)) if (pthread_create(resolver.thread + t, &attr, resolver_thread, NULL))
{ {
resolver.threads=t; resolver.threads=t;
break; break;
} }
} }
pthread_attr_destroy(&attr);
if (!resolver.threads) if (!resolver.threads)
{ {
// could not start any threads // could not start any threads

Loading…
Cancel
Save