[gnet-dev] two patches against gnet-1.1.7



I've experienced some apparently random crashes in linux pthreads
(pthread_exit, things like that) under very heavy load using gnet, and
I've found enough other reports out there with google in various
contexts that it doesn't seem to be a gnet specific problem, or a
problem with my code.  The same loads work fine using the fork-based DNS
code in gnet, so I added a --disable-pthreads switch to the gnet
configure script.

The other patch fixes warnings in pack.c and unpack.c, not sure if these
have been fixed in CVS or not.

Ian
--- gnet-1.1.7.orig/configure.ac	Mon Oct  7 11:51:03 2002
+++ gnet-1.1.7/configure.ac	Fri Oct 18 22:14:19 2002
@@ -105,17 +105,25 @@
 AC_CHECK_LIB([resolv], [main])
 
 # Wacky pthread madness
-pthread_libs=""
-AC_CHECK_LIB([pthread],
-	     [pthread_create],
-	     [pthread_libs="-lpthread"])
-AC_CHECK_LIB([c_r],
-	     [pthread_create],
-	     [pthread_libs="-lc_r"])
-if test "$pthread_libs"; then
-	AC_DEFINE(HAVE_LIBPTHREAD, 1,
-		  [Define if pthreads library is available])
-	LIBS="$pthread_libs $LIBS"
+AC_ARG_ENABLE(pthreads,
+	      AC_HELP_STRING([--disable-pthreads],
+			     [ignore pthreads library if present]),
+	      , # we don't need to do anything here
+	      enable_pthreads=yes)
+
+if test "x${enable_pthreads}" = "xyes"; then
+	pthread_libs=""
+	AC_CHECK_LIB([pthread],
+	     	[pthread_create],
+	     	[pthread_libs="-lpthread"])
+	AC_CHECK_LIB([c_r],
+	     	[pthread_create],
+	     	[pthread_libs="-lc_r"])
+	if test "$pthread_libs"; then
+		AC_DEFINE(HAVE_LIBPTHREAD, 1,
+		  	[Define if pthreads library is available])
+		LIBS="$pthread_libs $LIBS"
+	fi
 fi
 AC_SUBST(pthread_libs)
 
diff -r -u gnet-1.1.7.orig/tests/pack.c gnet-1.1.7/tests/pack.c
--- gnet-1.1.7.orig/tests/pack.c	Wed Aug 14 12:13:51 2002
+++ gnet-1.1.7/tests/pack.c	Fri Oct 18 22:24:47 2002
@@ -19,6 +19,7 @@
 
 #include <glib.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <gnet.h>
 
diff -r -u gnet-1.1.7.orig/tests/unpack.c gnet-1.1.7/tests/unpack.c
--- gnet-1.1.7.orig/tests/unpack.c	Wed Aug 14 12:13:51 2002
+++ gnet-1.1.7/tests/unpack.c	Fri Oct 18 22:24:59 2002
@@ -19,6 +19,8 @@
 
 #include <glib.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #include <gnet.h>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]