* configure.in: Added code to enable GUILE_ISELECT on systems
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Thu, 27 Nov 1997 18:03:06 +0000 (18:03 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Thu, 27 Nov 1997 18:03:06 +0000 (18:03 +0000)
which have the necessary functions (gettimeofday, select).

* acconfig.h: Added GUILE_ISELECT.

ChangeLog
NEWS
acconfig.h
configure.in

index f8b3292..61d55ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1997-11-27  Mikael Djurfeldt  <mdj@mdj.nada.kth.se>
+
+       * configure.in: Added code to enable GUILE_ISELECT on systems
+       which have the necessary functions (gettimeofday, select).
+
+       * acconfig.h: Added GUILE_ISELECT.
+
 1997-11-24  Tim Pierce  <twp@twp.tezcat.com>
 
        * acinclude.m4: Assume dlsym does not add underscore if
diff --git a/NEWS b/NEWS
index 22fd7b3..56eaed3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -375,6 +375,19 @@ missing.
 
 * Changes to the scm_ interface
 
+** Function: int scm_internal_select (int fds,
+                                     SELECT_TYPE *rfds,
+                                     SELECT_TYPE *wfds,
+                                     SELECT_TYPE *efds,
+                                     struct timeval *timeout);
+
+This is a replacement for the `select' function provided by the OS.
+It enables I/O blocking and sleeping to happen for one cooperative
+thread without blocking other threads.  It also avoids busy-loops in
+these situations.  It is intended that all I/O blocking and sleeping
+will finally go through this function.  Currently, this function is
+only available on systems providing `gettimeofday' and `select'.
+
 ** Function: SCM scm_internal_stack_catch (SCM tag,
                                           scm_catch_body_t body,
                                           void *body_data,
index 01b4a6f..64733e4 100644 (file)
@@ -51,6 +51,9 @@
    the Guile library itself.  */
 #undef GUILE_DEBUG
 
+/* Define to implement scm_internal_select */
+#undef GUILE_ISELECT
+
 /* Define if using cooperative multithreading.  */
 #undef USE_COOP_THREADS
 
index 813afe0..bae5865 100644 (file)
@@ -92,7 +92,7 @@ fi
 
 GUILE_DLSYM_USCORE
 
-AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gethostent gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid)
+AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gethostent gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid bzero)
 
 dnl <GNU-WIN32 hacks>
 
@@ -320,6 +320,19 @@ if test "$cy_cv_threads_package" != ""; then
   LIBOBJS="$LIBOBJS threads.o"
 fi
 
+#--------------------------------------------------------------------
+#
+# scm_internal_select
+#
+#--------------------------------------------------------------------
+
+if test "$cy_cv_threads_package" != "" &&
+   test $ac_cv_func_gettimeofday = yes &&
+   test $ac_cv_func_select = yes; then
+  AC_DEFINE(GUILE_ISELECT, 1)
+  LIBOBJS="$LIBOBJS iselect.o"
+fi
+
 ## If we're using GCC, ask for aggressive warnings.
 case "$GCC" in
   yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;;