From xemacs-m  Thu Jul 10 15:08:56 1997
Received: from ns1.eds.com (ns1.eds.com [192.85.154.78])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id PAA12705
	for <xemacs-beta@xemacs.org>; Thu, 10 Jul 1997 15:08:55 -0500 (CDT)
Received: from nnsa.eds.com (nnsa.eds.com [130.174.31.78])
	by ns1.eds.com (8.8.6/8.8.5) with ESMTP id QAA30794;
	Thu, 10 Jul 1997 16:08:52 -0400 (EDT)
Received: from kocrsv04.delcoelect.com (kocrsv04.delcoelect.com [144.250.100.205])
	by nnsa.eds.com (8.8.5/8.8.5) with ESMTP id QAA15558;
	Thu, 10 Jul 1997 16:08:20 -0400 (EDT)
Received: from kocrsw12.delcoelect.com (kocrsw12.delcoelect.com [144.250.106.18]) by kocrsv04.delcoelect.com (8.7.5/8.7.3) with SMTP id PAA06628; Thu, 10 Jul 1997 15:08:20 -0500 (EST)
Received: from kocrsw12 by kocrsw12.delcoelect.com (SMI-8.6/SMI-SVR4)
	id PAA27923; Thu, 10 Jul 1997 15:08:18 -0500
X-Mailer: exmh version 2.0gamma 1/27/97
To: georgn@canada.sun.com
cc: xemacs-beta@xemacs.org
Subject: Re: filelock.c 
X-Attribution: mts
X-Face: 4tk3bJx]I+QTZ|=]*1+Z){9+;5u_hK*NBeZK6[+B+iB%bVuOJ%^uK~fIG}O-}%WLX*D
 ^aW>Gv8E3Xtz0\N&fQl^:pj<K{xM`:d>pPt:9lF-YXB%O)?@rd?*/jE!s94`?]:jJ#C5RDP:;M
 r.3lwo`0{vIT+<{%IRwe]vLd]7>\X|*z{TUX_t;?TPcOLBMIv8_V92!Vk(*DJVU~0M[`5D^PAW
 LniO1?YYWArMU*j9o+>?1MWi.lO?F-?aVt:qQ8OaG?R}B:I!7S_+KuzxZ.f9M@$z#n\bG2$Q2{od
Date: Thu, 10 Jul 1997 15:08:16 -0500
Message-ID: <27921.868565296@kocrsw12>
From: Mike Scheidler <c23mts@eng.delcoelect.com>

"Georg" == Georg Nikodym <georgn@canada.sun.com> writes:
 Georg> 
 Georg> It is for the reasons Barry enumerates that I posted a patches that
 Georg> gave the builder the configure time option to disable file locking
 Georg> altogether.
 Georg> 
 Georg> Nobody cared at the time.  Perhaps, though, there's an archive?

Hey...I think I still have that lying around somewhere...yeah, here it is:

Date: Wed, 3 Jul 1996 19:15:39 -0400
From: Georg Nikodym <georgn@detlev.Canada.Sun.COM>
To: XEmacs Beta List <xemacs-beta@xemacs.org>
Subject: CLASH_DETECTION

I've finally had it with the file locking stuff so I went poking
around in an attempt to shut it off...

Here're the patches.  The patch to configure and src/config.h.in have
been tested.  The patch to configure.in represents some educated
guessing.

<BORING PEDANTRY>
Realizing that some people may actually want the clash detection stuff
on and working, I looked at the code and have the following
suggestions:

	1) Lose the notion of SuperLock.  If the rest of the world
	   is "correct" then SuperLock is nothing more than a
	   bottleneck to concurrent access to the lockdir.
	2) Lose the code in filelock.c that attempts to flush
	   attribute cache data with extraneous calls to opendir().
	   This is a kludge of biblical proportions.  There is nothing
	   stopping an implementor of NFS from developing a fancy
	   cache mechanism that breaks this code.
	
	   The better way is to utilize NFS mount options (if
	   available) to control attribute cache characteristics.  The
	   option in the Sun world is "noac" (mount_nfs(1M)) which
	   is useful for things like the clients of mail servers...

Other less though out things that come to mind are:

	1) Since each machine in a NFS world will have a portion of
	   it's FS namespace which is private to it, the clash
	   detection code should use a separate location that is
	   on local disk for this kind of housekeeping.

	2) Better yet, redesign the whole thing altogether since it's
	   completely broken anyway.  Additionally, this problem (if
	   it even qualifies as such) should really be solved outside
	   the domain of any single application...
<\BORING PEDANTRY>

Anyway, here they are:

*** configure-DIST	Wed Jul  3 16:52:52 1996
--- configure	Wed Jul  3 18:06:27 1996
***************
*** 95,100 ****
--- 95,101 ----
  with_x11=''
  rel_alloc='default'
  use_system_malloc='default'
+ use_clash_detection='no'
  internal_makefile_list='Makefile lib-src/Makefile.in man/Makefile.in src/Makefile.in lwlib/Makefile.in dynodump/Makefile.in'
  energize_version='no'
  native_sound_lib=''
***************
*** 296,301 ****
--- 297,303 ----
    			is system-dependent).
  --use-system-malloc	Force use of the system malloc, rather than GNU
  			malloc.
+ --use-clash-detection	Override default clash detection.  Default=no.
  
  You may also specify any of the \`path' variables found in
  Makefile.in, including --bindir, --libdir, --lispdir, --datadir, and
***************
*** 937,942 ****
--- 939,962 ----
            eval "${opt}=\"${val}\""
          ;;
  
+         ## Has the user specified explicit instructions for use_clash_detection?
+ 	"use_clash_detection" )
+ 	  ## Make sure the value given was either "yes", "no", or "default".
+ 	  case "${val}" in
+ 	    y | ye | yes )	val=yes ;;
+ 	    n | no )		val=no  ;;
+ 	    d | de | def | defa | defau | defaul | default )
+ 				val=default ;;
+ 	    * )
+ 	      (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value or \`default'.
+ Set it to either \`yes', \`no', or \`default'."
+ 	       echo "${short_usage}") >&2
+ 	      exit 1
+ 	    ;;
+ 	  esac
+           eval "${opt}=\"${val}\""
+         ;;
+ 
  	## Has the user tried to tell us where the X files are?
  	## I think these are dopey, but no less than three alpha
  	## testers, at large sites, have said they have their X files
***************
*** 3737,3742 ****
--- 3757,3768 ----
  configure___ system_malloc=no
  #endif
  
+ #ifdef USE_CLASH_DETECTION
+ configure__ use_clash_detection=yes
+ #else
+ configure__ use_clash_detection=no
+ #endif
+ 
  #ifndef C_DEBUG_SWITCH
  #define C_DEBUG_SWITCH -g
  #endif
***************
*** 7167,7172 ****
--- 7193,7214 ----
  }
   
  fi
+ 
+ if [ "${use_clash_detection}" = "yes" ]; then
+ 
+ {
+ test -n "$verbose" && \
+ echo "	defining USE_CLASH_DETECTION"
+ echo "#define" USE_CLASH_DETECTION "1" >> confdefs.h
+ DEFS="$DEFS -DUSE_CLASH_DETECTION=1"
+ ac_sed_defs="${ac_sed_defs}\${ac_dA}USE_CLASH_DETECTION\${ac_dB}USE_CLASH_DETECTION\${ac_dC}1\${ac_dD}
+ \${ac_uA}USE_CLASH_DETECTION\${ac_uB}USE_CLASH_DETECTION\${ac_uC}1\${ac_uD}
+ \${ac_eA}USE_CLASH_DETECTION\${ac_eB}USE_CLASH_DETECTION\${ac_eC}1\${ac_eD}
+ "
+ }
+ 
+ fi
+ 
  if [ "${rel_alloc}" = "yes" ] ; then
     
  {

*** src/config.h.in-DIST	Wed Jul  3 17:13:58 1996
--- src/config.h.in	Wed Jul  3 18:20:39 1996
***************
*** 103,112 ****
  
  #undef HAVE_LONG_FILE_NAMES
  
- #ifdef HAVE_LONG_FILE_NAMES
- #define CLASH_DETECTION
- #endif
- 
  #undef HAVE_LIBDNET
  #undef HAVE_LIBRESOLV
  
--- 103,108 ----
***************
*** 409,414 ****
--- 405,415 ----
  #define SYSTEM_MALLOC
  #endif
  
+ #undef USE_CLASH_DETECTION
+ #if defined(USE_CLASH_DETECTION) && !defined(CLASH_DETECTION)
+ #define CLASH_DETECTION
+ #endif
+ 
  #if 0 /* RMSmacs */
  /* These typedefs shouldn't appear when alloca.s or Makefile.in
     includes config.h.  */

*** configure.in-DIST	Wed Jul  3 16:52:44 1996
--- configure.in	Wed Jul  3 18:06:17 1996
***************
*** 110,115 ****
--- 110,116 ----
  with_x11=''
  rel_alloc='default'
  use_system_malloc='default'
+ use_clash_detection='no'
  internal_makefile_list='Makefile lib-src/Makefile.in man/Makefile.in src/Makefile.in lwlib/Makefile.in dynodump/Makefile.in'
  energize_version='no'
  native_sound_lib=''
***************
*** 311,316 ****
--- 312,318 ----
    			is system-dependent).
  --use-system-malloc	Force use of the system malloc, rather than GNU
  			malloc.
+ --use-clash-detection	Override default clash detection.  Default=no.
  
  You may also specify any of the \`path' variables found in
  Makefile.in, including --bindir, --libdir, --lispdir, --datadir, and
***************
*** 952,957 ****
--- 954,977 ----
            eval "${opt}=\"${val}\""
          ;;
  
+         ## Has the user specified explicit instructions for use_clash_detection?
+ 	"use_clash_detection" )
+ 	  ## Make sure the value given was either "yes", "no", or "default".
+ 	  case "${val}" in
+ 	    y | ye | yes )	val=yes ;;
+ 	    n | no )		val=no  ;;
+ 	    d | de | def | defa | defau | defaul | default )
+ 				val=default ;;
+ 	    * )
+ 	      (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value or \`default'.
+ Set it to either \`yes', \`no', or \`default'."
+ 	       echo "${short_usage}") >&2
+ 	      exit 1
+ 	    ;;
+ 	  esac
+           eval "${opt}=\"${val}\""
+         ;;
+ 
  	## Has the user tried to tell us where the X files are?
  	## I think these are dopey, but no less than three alpha
  	## testers, at large sites, have said they have their X files
***************
*** 2910,2915 ****
--- 2930,2941 ----
  configure___ system_malloc=no
  #endif
  
+ #ifdef USE_CLASH_DETECTION
+ configure__ use_clash_detection=yes
+ #else
+ congigure__ use_clash_detection=no
+ #endif
+ 
  #ifndef C_DEBUG_SWITCH
  #define C_DEBUG_SWITCH -g
  #endif
***************
*** 4021,4026 ****
--- 4047,4055 ----
  elif [ "${use_system_malloc}" = "yes" ]; then
    ] AC_DEFINE(USE_SYSTEM_MALLOC) [
  fi
+ if [ "${use_clash_detection} = "yes" ]; then
+   ] AC_DEFINE(USE_CLASH_DETECTION) [
+ fi
  if [ "${rel_alloc}" = "yes" ] ; then
    ] AC_DEFINE(REL_ALLOC) [
  fi

-- 
Mike Scheidler                     c23mts@eng.delcoelect.com
Corporate Software Technology
Delco Electronics Corporation      PHONE:  (765) 451-0319
Kokomo, IN 46904-9005              GMNET:  8-322-0319


