Update of /cvsroot/q-lang/q/src
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13574/src
Modified Files:
qm.c qmfuns.c
Log Message:
get rid of the global reads mutex (experimental)
Index: qm.c
===================================================================
RCS file: /cvsroot/q-lang/q/src/qm.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** qm.c 15 Oct 2007 10:15:39 -0000 1.91
--- qm.c 1 Dec 2007 12:29:57 -0000 1.92
***************
*** 239,249 ****
pthread_mutex_lock(&input_mutex);
#if 0
! /* NOTE: We don't lock the tty and parse mutexes, since that would suspend a
! fork in a background thread when the interpreter sits waiting in the main
! loop. */
pthread_mutex_lock(&tty_mutex);
pthread_mutex_lock(&parse_mutex);
- #endif
pthread_mutex_lock(&reads_mutex);
if (nused > 1)
for (thr = thr0+1; thr < thr0+nthreads; thr++)
--- 239,249 ----
pthread_mutex_lock(&input_mutex);
#if 0
! /* NOTE: We don't lock the tty, parse and reads mutexes, since that would
! suspend a fork in a background thread when some other thread (or the main
! loop) sits waiting reading from a tty or file. */
pthread_mutex_lock(&tty_mutex);
pthread_mutex_lock(&parse_mutex);
pthread_mutex_lock(&reads_mutex);
+ #endif
if (nused > 1)
for (thr = thr0+1; thr < thr0+nthreads; thr++)
***************
*** 265,270 ****
pthread_mutex_unlock(&tty_mutex);
pthread_mutex_unlock(&parse_mutex);
- #endif
pthread_mutex_unlock(&reads_mutex);
if (nused > 1)
for (thr = thr0+1; thr < thr0+nthreads; thr++)
--- 265,270 ----
pthread_mutex_unlock(&tty_mutex);
pthread_mutex_unlock(&parse_mutex);
pthread_mutex_unlock(&reads_mutex);
+ #endif
if (nused > 1)
for (thr = thr0+1; thr < thr0+nthreads; thr++)
Index: qmfuns.c
===================================================================
RCS file: /cvsroot/q-lang/q/src/qmfuns.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -d -r1.81 -r1.82
*** qmfuns.c 3 Oct 2007 02:59:36 -0000 1.81
--- qmfuns.c 1 Dec 2007 12:29:57 -0000 1.82
***************
*** 4487,4492 ****
--- 4487,4494 ----
release_lock();
if (fp == stdin) acquire_tty();
+ #if 0
pthread_mutex_lock(&reads_mutex);
#endif
+ #endif
while((r = fgets(t, MAXSTRLEN, fp)) && *t &&
t[(l = strlen(t))-1] != '\n') {
***************
*** 4502,4506 ****
--- 4504,4510 ----
free(s);
#ifdef USE_THREADS
+ #if 0
pthread_mutex_unlock(&reads_mutex);
+ #endif
if (fp == stdin) release_tty();
acquire_lock();
***************
*** 4513,4517 ****
--- 4517,4523 ----
t[l-1] = 0;
#ifdef USE_THREADS
+ #if 0
pthread_mutex_unlock(&reads_mutex);
+ #endif
if (fp == stdin) release_tty();
acquire_lock();
|