q-lang-cvs Mailing List for Q - Equational Programming Language (Page 3)
Brought to you by:
agraef
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(106) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(219) |
Feb
(152) |
Mar
|
Apr
(92) |
May
(45) |
Jun
(3) |
Jul
|
Aug
(3) |
Sep
(111) |
Oct
(52) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(23) |
Jun
(46) |
Jul
(158) |
Aug
(22) |
Sep
|
Oct
(26) |
Nov
(11) |
Dec
(49) |
2006 |
Jan
(57) |
Feb
(196) |
Mar
(10) |
Apr
(41) |
May
(149) |
Jun
(308) |
Jul
(11) |
Aug
(25) |
Sep
(15) |
Oct
|
Nov
|
Dec
(15) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(15) |
May
(204) |
Jun
(112) |
Jul
(7) |
Aug
(16) |
Sep
(134) |
Oct
(313) |
Nov
(262) |
Dec
(83) |
2008 |
Jan
(81) |
Feb
(83) |
Mar
(21) |
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Albert G. <ag...@us...> - 2008-02-23 08:37:34
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29126 Modified Files: configure.in Log Message: add hires timer functions Index: configure.in =================================================================== RCS file: /cvsroot/q-lang/q/configure.in,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** configure.in 22 Feb 2008 12:55:28 -0000 1.60 --- configure.in 23 Feb 2008 08:37:29 -0000 1.61 *************** *** 658,662 **** AC_CHECK_FUNCS(memcpy memmove memset memcmp strdup strsignal strstr) dnl auxiliary timing functions ! AC_CHECK_FUNCS(ftime gettimeofday clock_gettime nanosleep usleep) dnl various system functions AC_CHECK_FUNCS(backtrace setlinebuf select sysconf) --- 658,662 ---- AC_CHECK_FUNCS(memcpy memmove memset memcmp strdup strsignal strstr) dnl auxiliary timing functions ! AC_CHECK_FUNCS(ftime gettimeofday clock_gettime clock_getres clock_nanosleep nanosleep usleep) dnl various system functions AC_CHECK_FUNCS(backtrace setlinebuf select sysconf) |
From: Albert G. <ag...@us...> - 2008-02-23 08:34:17
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27647 Modified Files: NEWS Log Message: update NEWS Index: NEWS =================================================================== RCS file: /cvsroot/q-lang/q/NEWS,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** NEWS 21 Feb 2008 23:11:07 -0000 1.144 --- NEWS 23 Feb 2008 08:34:11 -0000 1.145 *************** *** 3,7 **** ======= ! * 7.11 21 February 2008 - As suggested by Rob Hubbard and John Cowan, special Unicode characters in --- 3,7 ---- ======= ! * 7.11 23 February 2008 - As suggested by Rob Hubbard and John Cowan, special Unicode characters in *************** *** 19,22 **** --- 19,28 ---- - The glob and regex functions were moved back from system into clib. + - Added support for highres timers (clock_gettime et al) on systems where the + POSIX timer extension is available. The system module provides a number of + new functions (nanotime, nanosleep, etc.) to deal with these. Moreover, the + builtin time function will now also make use of clock_gettime (or + gettimeofday) if they are available. + - Worked around some quirks with the MS Access ODBC driver which caused it to reject NULL and empty string parameter values in SQL insert statements. |
From: Albert G. <ag...@us...> - 2008-02-23 08:33:35
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27618 Modified Files: ChangeLog Log Message: update ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/q-lang/q/ChangeLog,v retrieving revision 1.332 retrieving revision 1.333 diff -C2 -d -r1.332 -r1.333 *** ChangeLog 22 Feb 2008 12:57:05 -0000 1.332 --- ChangeLog 23 Feb 2008 08:33:31 -0000 1.333 *************** *** 1,2 **** --- 1,13 ---- + 2008-02-23 Albert Graef <Dr....@t-...> + + + 7.11 + + * modules/clib/system.q, system.c: support for highres timers + + New functions (nanotime, nanosleep, etc.) are provided to access + the POSIX 1003.1-2001 timer functions (clock_gettime et al). The + interface supports all the available standard (realtime, + monotonic, cpu process and thread) timers. + 2008-02-22 Albert Graef <Dr....@t-...> |
From: Albert G. <ag...@us...> - 2008-02-22 13:03:39
|
Update of /cvsroot/q-lang/q/modules/clib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9656 Modified Files: clib.q Log Message: comment change Index: clib.q =================================================================== RCS file: /cvsroot/q-lang/q/modules/clib/clib.q,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** clib.q 22 Feb 2008 08:17:16 -0000 1.38 --- clib.q 22 Feb 2008 13:03:35 -0000 1.39 *************** *** 26,34 **** replacements for common standard library functions, additional string and GMP integer functions, extended file I/O (including C-style formatted I/O), ! byte strings, references, threads and, last but not least, the exit ! function. You should be able to access these without further ado in any ! standard (i.e., "vanilla") Q installation. All other types and operations ! described in Section "Clib" of the manual are now implemented in the ! 'system' module. */ import stdlib, string, tuple; --- 26,34 ---- replacements for common standard library functions, additional string and GMP integer functions, extended file I/O (including C-style formatted I/O), ! byte strings, references, threads, filename globbing, regex and, last but ! not least, the exit function. You should be able to access these without ! further ado in any standard (i.e., "vanilla") Q installation. All other ! types and operations described in Section "Clib" of the manual are now ! implemented in the 'system' module. */ import stdlib, string, tuple; |
From: Albert G. <ag...@us...> - 2008-02-22 12:57:11
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6556 Modified Files: ChangeLog Log Message: update ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/q-lang/q/ChangeLog,v retrieving revision 1.331 retrieving revision 1.332 diff -C2 -d -r1.331 -r1.332 *** ChangeLog 22 Feb 2008 11:34:00 -0000 1.331 --- ChangeLog 22 Feb 2008 12:57:05 -0000 1.332 *************** *** 1,4 **** --- 1,9 ---- 2008-02-22 Albert Graef <Dr....@t-...> + * src/sys.c: support for highres timers + + On systems where clock_gettime or gettimeofday is available, they + will be used for the builtin time function instead of ftime/time. + * modules/clib/clib.c: bugfix: timeout for await is specified in seconds, not milliseconds |
From: Albert G. <ag...@us...> - 2008-02-22 12:55:33
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5741 Modified Files: configure.in Log Message: add support for highres timers Index: configure.in =================================================================== RCS file: /cvsroot/q-lang/q/configure.in,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** configure.in 22 Feb 2008 11:35:12 -0000 1.59 --- configure.in 22 Feb 2008 12:55:28 -0000 1.60 *************** *** 84,87 **** --- 84,90 ---- AC_CHECK_LIB(util, openpty) + # highres timers (POSIX 1003.1-2001) + AC_CHECK_LIB(rt, clock_gettime) + # password encryption AC_CHECK_LIB(crypt, crypt) *************** *** 655,659 **** AC_CHECK_FUNCS(memcpy memmove memset memcmp strdup strsignal strstr) dnl auxiliary timing functions ! AC_CHECK_FUNCS(ftime nanosleep usleep) dnl various system functions AC_CHECK_FUNCS(backtrace setlinebuf select sysconf) --- 658,662 ---- AC_CHECK_FUNCS(memcpy memmove memset memcmp strdup strsignal strstr) dnl auxiliary timing functions ! AC_CHECK_FUNCS(ftime gettimeofday clock_gettime nanosleep usleep) dnl various system functions AC_CHECK_FUNCS(backtrace setlinebuf select sysconf) |
From: Albert G. <ag...@us...> - 2008-02-22 12:55:33
|
Update of /cvsroot/q-lang/q/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5741/src Modified Files: sys.c Log Message: add support for highres timers Index: sys.c =================================================================== RCS file: /cvsroot/q-lang/q/src/sys.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sys.c 22 Feb 2008 11:55:51 -0000 1.3 --- sys.c 22 Feb 2008 12:55:29 -0000 1.4 *************** *** 166,169 **** --- 166,194 ---- } + #ifdef HAVE_CLOCK_GETTIME + + double systime(void) + { + struct timespec tv; + int res = clock_gettime(CLOCK_REALTIME, &tv); + if (res) + return 0.0; + else + return ((double)tv.tv_sec)+((double)tv.tv_nsec)*1e-9; + } + + #else + + #ifdef HAVE_GETTIMEOFDAY + + double systime(void) + { + struct timeval tv; + gettimeofday(&tv, NULL); + return ((double)tv.tv_sec)+((double)tv.tv_usec)*1e-6; + } + + #else + #ifdef HAVE_FTIME *************** *** 186,189 **** --- 211,218 ---- #endif + #endif + + #endif + #ifndef _WIN32 |
From: Albert G. <ag...@us...> - 2008-02-22 11:56:09
|
Update of /cvsroot/q-lang/q/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27732/src Modified Files: qmfuns.c sys.c Log Message: systime() and syssleep() use time values in seconds rather than millisecs Index: sys.c =================================================================== RCS file: /cvsroot/q-lang/q/src/sys.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sys.c 24 Sep 2007 12:21:03 -0000 1.2 --- sys.c 22 Feb 2008 11:55:51 -0000 1.3 *************** *** 174,178 **** struct timeb tb; ftime(&tb); ! return ((double)tb.time)*1e3+((double)tb.millitm); } --- 174,178 ---- struct timeb tb; ftime(&tb); ! return ((double)tb.time)+((double)tb.millitm)*1e-3; } *************** *** 181,185 **** double systime(void) { ! return (double)time(NULL)*1e3; } --- 181,185 ---- double systime(void) { ! return (double)time(NULL); } *************** *** 196,200 **** unsigned long nsecs; struct timespec req; ! fp = modf(t/1e3, &ip); if (ip > LONG_MAX) { ip = (double)LONG_MAX; fp = 0.0; } secs = (unsigned long)ip; --- 196,200 ---- unsigned long nsecs; struct timespec req; ! fp = modf(t, &ip); if (ip > LONG_MAX) { ip = (double)LONG_MAX; fp = 0.0; } secs = (unsigned long)ip; *************** *** 205,215 **** #ifdef HAVE_USLEEP unsigned long usecs; ! if (t*1e3 > LONG_MAX) t = LONG_MAX/1e3; ! fp = modf(t/1e3, &ip); secs = (unsigned long)ip; usecs = (unsigned long)(fp*1e6); usleep(secs*1000000U+usecs); #else ! fp = modf(t/1e3, &ip); if (ip > LONG_MAX) ip = (double)LONG_MAX; secs = (unsigned long)ip; --- 205,215 ---- #ifdef HAVE_USLEEP unsigned long usecs; ! if (t > LONG_MAX) t = LONG_MAX; ! fp = modf(t, &ip); secs = (unsigned long)ip; usecs = (unsigned long)(fp*1e6); usleep(secs*1000000U+usecs); #else ! fp = modf(t, &ip); if (ip > LONG_MAX) ip = (double)LONG_MAX; secs = (unsigned long)ip; *************** *** 231,235 **** double ip, fp; if (t > LONG_MAX) t = LONG_MAX; ! fp = modf(t/1e3, &ip); secs = (unsigned long)ip; msecs = (unsigned short)(fp*1e3); --- 231,235 ---- double ip, fp; if (t > LONG_MAX) t = LONG_MAX; ! fp = modf(t, &ip); secs = (unsigned long)ip; msecs = (unsigned short)(fp*1e3); Index: qmfuns.c =================================================================== RCS file: /cvsroot/q-lang/q/src/qmfuns.c,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** qmfuns.c 1 Dec 2007 12:29:57 -0000 1.82 --- qmfuns.c 22 Feb 2008 11:55:51 -0000 1.83 *************** *** 5097,5101 **** static qmtime(THREAD* thr) { ! return pushfloat(thr, systime()/1e3); } --- 5097,5101 ---- static qmtime(THREAD* thr) { ! return pushfloat(thr, systime()); } *************** *** 5109,5113 **** release_lock(); #endif ! syssleep(d*1e3); #ifdef USE_THREADS acquire_lock(); --- 5109,5113 ---- release_lock(); #endif ! syssleep(d); #ifdef USE_THREADS acquire_lock(); *************** *** 5119,5123 **** release_lock(); #endif ! syssleep(args[0]->data.f*1e3); #ifdef USE_THREADS acquire_lock(); --- 5119,5123 ---- release_lock(); #endif ! syssleep(args[0]->data.f); #ifdef USE_THREADS acquire_lock(); |
From: Albert G. <ag...@us...> - 2008-02-22 11:35:17
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13532 Modified Files: configure.in Log Message: check for availability of pthread_mutex_timedlock and sem_timedwait functions Index: configure.in =================================================================== RCS file: /cvsroot/q-lang/q/configure.in,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** configure.in 16 Jan 2008 09:07:37 -0000 1.58 --- configure.in 22 Feb 2008 11:35:12 -0000 1.59 *************** *** 676,680 **** OLDLIBS=$LIBS LIBS="$LIBS $LIBPTHREAD" ! AC_CHECK_FUNCS(pthread_atfork) LIBS=$OLDLIBS dnl freetype2 support --- 676,680 ---- OLDLIBS=$LIBS LIBS="$LIBS $LIBPTHREAD" ! AC_CHECK_FUNCS(pthread_atfork pthread_mutex_timedlock sem_timedwait) LIBS=$OLDLIBS dnl freetype2 support |
From: Albert G. <ag...@us...> - 2008-02-22 11:34:07
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12922 Modified Files: ChangeLog Log Message: update ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/q-lang/q/ChangeLog,v retrieving revision 1.330 retrieving revision 1.331 diff -C2 -d -r1.330 -r1.331 *** ChangeLog 21 Feb 2008 08:25:16 -0000 1.330 --- ChangeLog 22 Feb 2008 11:34:00 -0000 1.331 *************** *** 1,2 **** --- 1,21 ---- + 2008-02-22 Albert Graef <Dr....@t-...> + + * modules/clib/clib.c: bugfix: timeout for await is specified in + seconds, not milliseconds + + new: allow timeouts to be specified with try function on mutexes + and semaphores + + This allows mutexes and semaphores to be locked/read with an + absolute timeout value, using try (MUTEX,TIME) or try (SEM,TIME) + instead of just try MUTEX or try SEM. This works analogously to + await (COND,TIME) which has always been available. + + NOTE: The new try timeout functionality is only available on newer + systems which already have the pthread_mutex_timedlock and + sem_timedwait routines in the POSIX threads library. Otherwise the + timeout value will just be ignored, i.e., the routines will return + immediately (as if no timeout value was specified). + 2008-02-21 Albert Graef <Dr....@t-...> |
From: Albert G. <ag...@us...> - 2008-02-22 09:31:29
|
Update of /cvsroot/q-lang/q/doc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21765 Modified Files: qdoc.texi version.texi Log Message: update documentation Index: qdoc.texi =================================================================== RCS file: /cvsroot/q-lang/q/doc/qdoc.texi,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** qdoc.texi 23 Jan 2008 07:09:07 -0000 1.146 --- qdoc.texi 22 Feb 2008 09:31:24 -0000 1.147 *************** *** 13546,13550 **** @code{lock} (wait for the mutex to be unlocked, then lock it and return @code{()}), @code{unlock} (unlock the mutex, return @code{()}) and ! @code{try} (lock the mutex if it is available, fail otherwise). @b{CAVEAT:} These operations are @emph{dangerous}, as you can easily --- 13546,13555 ---- @code{lock} (wait for the mutex to be unlocked, then lock it and return @code{()}), @code{unlock} (unlock the mutex, return @code{()}) and ! @code{try} (lock the mutex if it is available, fail otherwise). As of Q ! 7.11, on systems which support this functionality, the @code{try} ! operation can also be used with an argument of the form @code{(MUTEX, ! TIME)} to denote an absolute timeout value. This works analogously to ! the @code{await} operation on conditions, see @ref{Conditions}, for ! details. @b{CAVEAT:} These operations are @emph{dangerous}, as you can easily *************** *** 13584,13588 **** public extern lock MUTEX; // lock MUTEX public extern unlock MUTEX; // unlock MUTEX ! public extern try MUTEX; // try MUTEX @end smallexample --- 13589,13593 ---- public extern lock MUTEX; // lock MUTEX public extern unlock MUTEX; // unlock MUTEX ! public extern try MUTEX; // try MUTEX, (MUTEX,TIME) for timeout @end smallexample *************** *** 13639,13643 **** available), @code{get_size} or @code{#} which both return the current queue size, and @code{get_bound} which returns the queue size limit of a ! bounded semaphore (or zero if the semaphore is unbounded). Note that even with unbounded semaphores the maximum semaphore size is --- 13644,13652 ---- available), @code{get_size} or @code{#} which both return the current queue size, and @code{get_bound} which returns the queue size limit of a ! bounded semaphore (or zero if the semaphore is unbounded). As of Q 7.11, ! on systems which support this functionality, the @code{try} operation ! can also be used with an argument of the form @code{(SEM, TIME)} to ! denote an absolute timeout value. This works analogously to the ! @code{await} operation on conditions, see @ref{Conditions}, for details. Note that even with unbounded semaphores the maximum semaphore size is *************** *** 13666,13670 **** public extern post SEM X; // enqueue a value public extern get SEM; // dequeue a value ! public extern try SEM; // dequeue a value, fail if none public extern get_size SEM; // get the current queue size --- 13675,13679 ---- public extern post SEM X; // enqueue a value public extern get SEM; // dequeue a value ! public extern try SEM; // try SEM, (SEM,TIME) for timeout public extern get_size SEM; // get the current queue size Index: version.texi =================================================================== RCS file: /cvsroot/q-lang/q/doc/version.texi,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** version.texi 23 Jan 2008 06:23:38 -0000 1.98 --- version.texi 22 Feb 2008 09:31:24 -0000 1.99 *************** *** 1,4 **** ! @set UPDATED 23 January 2008 ! @set UPDATED-MONTH January 2008 @set EDITION 7.11 @set VERSION 7.11 --- 1,4 ---- ! @set UPDATED 22 February 2008 ! @set UPDATED-MONTH February 2008 @set EDITION 7.11 @set VERSION 7.11 |
From: Albert G. <ag...@us...> - 2008-02-22 08:42:54
|
Update of /cvsroot/q-lang/q/modules/clib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14876 Modified Files: clib.c Log Message: TODO: check that these are available on Windows Index: clib.c =================================================================== RCS file: /cvsroot/q-lang/q/modules/clib/clib.c,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** clib.c 22 Feb 2008 08:23:49 -0000 1.88 --- clib.c 22 Feb 2008 08:42:50 -0000 1.89 *************** *** 136,139 **** --- 136,142 ---- #endif + #define HAVE_PTHREAD_MUTEX_TIMEDLOCK 1 + #define HAVE_SEM_TIMEDWAIT 1 + #endif |
From: Albert G. <ag...@us...> - 2008-02-22 08:23:54
|
Update of /cvsroot/q-lang/q/modules/clib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6967 Modified Files: clib.c Log Message: check for availability of pthread_mutex_timedlock and sem_timedwait functions Index: clib.c =================================================================== RCS file: /cvsroot/q-lang/q/modules/clib/clib.c,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** clib.c 22 Feb 2008 08:12:38 -0000 1.87 --- clib.c 22 Feb 2008 08:23:49 -0000 1.88 *************** *** 5795,5798 **** --- 5795,5799 ---- int res; check_mut(mut); + #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK if (tset) { release_lock(); *************** *** 5800,5803 **** --- 5801,5805 ---- acquire_lock(); } else + #endif res = pthread_mutex_trylock(&mut->mut); if (res) *************** *** 5810,5816 **** --- 5812,5820 ---- check_sem(sem); release_lock(); + #ifdef HAVE_SEM_TIMEDWAIT if (tset) res = sem_timedwait(sem->semp, &tspec); else + #endif res = sem_trywait(sem->semp); if (!res) { |
From: Albert G. <ag...@us...> - 2008-02-22 08:17:21
|
Update of /cvsroot/q-lang/q/modules/clib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4397 Modified Files: clib.q Log Message: add timed try for mutex and semaphore Index: clib.q =================================================================== RCS file: /cvsroot/q-lang/q/modules/clib/clib.q,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** clib.q 23 Jan 2008 05:56:06 -0000 1.37 --- clib.q 22 Feb 2008 08:17:16 -0000 1.38 *************** *** 406,410 **** public extern lock MUTEX; // lock MUTEX public extern unlock MUTEX; // unlock MUTEX ! public extern try MUTEX; // try MUTEX /* Conditions. */ --- 406,410 ---- public extern lock MUTEX; // lock MUTEX public extern unlock MUTEX; // unlock MUTEX ! public extern try MUTEX; // try MUTEX, (MUTEX,TIME) for timeout /* Conditions. */ *************** *** 437,441 **** public extern post SEM X; // enqueue a value public extern get SEM; // dequeue a value ! public extern try SEM; // dequeue a value, fail if none public extern get_size SEM; // get the current queue size --- 437,441 ---- public extern post SEM X; // enqueue a value public extern get SEM; // dequeue a value ! public extern try SEM; // try SEM, (SEM,TIME) for timeout public extern get_size SEM; // get the current queue size |
From: Albert G. <ag...@us...> - 2008-02-22 08:12:43
|
Update of /cvsroot/q-lang/q/modules/clib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2239 Modified Files: clib.c Log Message: bugfix: timeout is specified in seconds, not milliseconds Index: clib.c =================================================================== RCS file: /cvsroot/q-lang/q/modules/clib/clib.c,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** clib.c 22 Feb 2008 07:47:51 -0000 1.86 --- clib.c 22 Feb 2008 08:12:38 -0000 1.87 *************** *** 5784,5788 **** unsigned long secs; unsigned long nsecs; ! fp = modf(t/1e3, &ip); if (ip > LONG_MAX) { ip = (double)LONG_MAX; fp = 0.0; } secs = (unsigned long)ip; --- 5784,5788 ---- unsigned long secs; unsigned long nsecs; ! fp = modf(t, &ip); if (ip > LONG_MAX) { ip = (double)LONG_MAX; fp = 0.0; } secs = (unsigned long)ip; *************** *** 5897,5901 **** unsigned long secs; unsigned long nsecs; ! fp = modf(t/1e3, &ip); if (ip > LONG_MAX) { ip = (double)LONG_MAX; fp = 0.0; } secs = (unsigned long)ip; --- 5897,5901 ---- unsigned long secs; unsigned long nsecs; ! fp = modf(t, &ip); if (ip > LONG_MAX) { ip = (double)LONG_MAX; fp = 0.0; } secs = (unsigned long)ip; |
From: Albert G. <ag...@us...> - 2008-02-22 07:47:55
|
Update of /cvsroot/q-lang/q/modules/clib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23116 Modified Files: clib.c Log Message: add timed try for mutex and semaphore Index: clib.c =================================================================== RCS file: /cvsroot/q-lang/q/modules/clib/clib.c,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** clib.c 23 Jan 2008 05:24:32 -0000 1.85 --- clib.c 22 Feb 2008 07:47:51 -0000 1.86 *************** *** 5773,5789 **** my_mutex_t *mut; my_sem_t *sem; ! if (argc == 1) ! if (isobj(argv[0], type(Mutex), (void**)&mut)) { check_mut(mut); ! if (pthread_mutex_trylock(&mut->mut)) return __FAIL; else return mkvoid; ! } else if (isobj(argv[0], type(Semaphore), (void**)&sem)) { int res; expr val; check_sem(sem); release_lock(); ! res = sem_trywait(sem->semp); if (!res) { pthread_mutex_lock(&sem->mut); --- 5773,5817 ---- my_mutex_t *mut; my_sem_t *sem; ! if (argc == 1) { ! int n; ! expr x = argv[0], *v; ! double t; ! struct timespec tspec; ! bool tset = 0; ! if (istuple(x, &n, &v) && n == 2 && ! (isfloat(v[1], &t) || ismpz_float(v[1], &t))) { ! double ip, fp; ! unsigned long secs; ! unsigned long nsecs; ! fp = modf(t/1e3, &ip); ! if (ip > LONG_MAX) { ip = (double)LONG_MAX; fp = 0.0; } ! secs = (unsigned long)ip; ! nsecs = (unsigned long)(fp*1e9); ! tspec.tv_sec = secs; tspec.tv_nsec = nsecs; ! x = v[0]; ! tset = 1; ! } ! if (isobj(x, type(Mutex), (void**)&mut)) { ! int res; check_mut(mut); ! if (tset) { ! release_lock(); ! res = pthread_mutex_timedlock(&mut->mut, &tspec); ! acquire_lock(); ! } else ! res = pthread_mutex_trylock(&mut->mut); ! if (res) return __FAIL; else return mkvoid; ! } else if (isobj(x, type(Semaphore), (void**)&sem)) { int res; expr val; check_sem(sem); release_lock(); ! if (tset) ! res = sem_timedwait(sem->semp, &tspec); ! else ! res = sem_trywait(sem->semp); if (!res) { pthread_mutex_lock(&sem->mut); *************** *** 5803,5807 **** } else return __FAIL; ! else #endif return __FAIL; --- 5831,5835 ---- } else return __FAIL; ! } else #endif return __FAIL; |
From: Albert G. <ag...@us...> - 2008-02-21 23:11:11
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24990 Modified Files: NEWS Log Message: fix typo Index: NEWS =================================================================== RCS file: /cvsroot/q-lang/q/NEWS,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** NEWS 21 Feb 2008 08:25:41 -0000 1.143 --- NEWS 21 Feb 2008 23:11:07 -0000 1.144 *************** *** 31,35 **** Jiri rewrote the algorithm in Q and also added the deletion operations which were missing in the Prolog version. Tests indicate that updating the ! new data structures is at least twice at fast for large trees, quite a notable improvement! --- 31,35 ---- Jiri rewrote the algorithm in Q and also added the deletion operations which were missing in the Prolog version. Tests indicate that updating the ! new data structures is at least twice as fast for large trees, quite a notable improvement! |
From: Albert G. <ag...@us...> - 2008-02-21 21:14:24
|
Update of /cvsroot/q-lang/q/stdlib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9507 Modified Files: hdict.q Log Message: missing argument in deletea Index: hdict.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/hdict.q,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hdict.q 21 Feb 2008 09:03:07 -0000 1.8 --- hdict.q 21 Feb 2008 21:14:03 -0000 1.9 *************** *** 208,212 **** private deletea2 _ _; ! deletea nil _ = (nil, false); deletea (bin Key XYs B nil R ) Key X --- 208,212 ---- private deletea2 _ _; ! deletea nil _ _ = (nil, false); deletea (bin Key XYs B nil R ) Key X |
From: Albert G. <ag...@us...> - 2008-02-21 19:58:54
|
Update of /cvsroot/q-lang/q/stdlib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9618 Modified Files: bag.q dict.q set.q Log Message: bugfix: check keys for semantic rather than syntactic equality Index: bag.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/bag.q,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** bag.q 21 Feb 2008 09:03:04 -0000 1.7 --- bag.q 21 Feb 2008 19:58:49 -0000 1.8 *************** *** 152,159 **** deletea nil _ = (nil, false); ! deletea (bin Key _ nil R ) Key = (R, true); ! deletea (bin Key _ L nil) Key = (L, true); ! deletea (bin Key B (bin KL BL RL LL) R) Key = adjustd LeftHasChanged (bin LastK B NewL R) left where --- 152,159 ---- deletea nil _ = (nil, false); ! deletea (bin K _ nil R ) Key = (R, true) if Key = K; ! deletea (bin K _ L nil) Key = (L, true) if Key = K; ! deletea (bin K B (bin KL BL RL LL) R) Key if Key = K: = adjustd LeftHasChanged (bin LastK B NewL R) left where Index: dict.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/dict.q,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dict.q 21 Feb 2008 11:48:29 -0000 1.10 --- dict.q 21 Feb 2008 19:58:49 -0000 1.11 *************** *** 132,137 **** inserta nil Key Val = ((bin Key Val iseq nil nil), true); ! inserta (bin Key _ B L R) Key Val ! = ((bin Key Val B L R), false); inserta (bin K V B L R) Key Val if Key < K: --- 132,136 ---- inserta nil Key Val = ((bin Key Val iseq nil nil), true); ! inserta (bin K _ B L R) Key Val = ((bin Key Val B L R), false) if Key = K; inserta (bin K V B L R) Key Val if Key < K: *************** *** 162,171 **** deletea nil _ = (nil, false); ! deletea (bin Key _ _ nil R ) Key ! = (R, true); ! deletea (bin Key _ _ L nil) Key ! = (L, true); ! deletea (bin Key _ B (bin KL VL BL RL LL) R ) Key = adjustd LeftHasChanged (bin LastK LastV B NewL R) left where --- 161,168 ---- deletea nil _ = (nil, false); ! deletea (bin K _ _ nil R ) Key = (R, true) if Key = K; ! deletea (bin K _ _ L nil) Key = (L, true) if Key = K; ! deletea (bin K _ B (bin KL VL BL RL LL) R ) Key if Key = K: = adjustd LeftHasChanged (bin LastK LastV B NewL R) left where Index: set.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/set.q,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** set.q 21 Feb 2008 09:03:08 -0000 1.8 --- set.q 21 Feb 2008 19:58:49 -0000 1.9 *************** *** 130,134 **** inserta nil Key = ((bin Key iseq nil nil), true); ! inserta (bin Key B L R) Key = ((bin Key B L R), false); inserta (bin K B L R) Key if Key < K: --- 130,134 ---- inserta nil Key = ((bin Key iseq nil nil), true); ! inserta (bin K B L R) Key = ((bin Key B L R), false) if Key = K; inserta (bin K B L R) Key if Key < K: *************** *** 155,162 **** deletea nil _ = (nil, false); ! deletea (bin Key _ nil R ) Key = (R, true); ! deletea (bin Key _ L nil) Key = (L, true); ! deletea (bin Key B (bin KL BL RL LL) R) Key = adjustd LeftHasChanged (bin LK B NewL R) left where --- 155,162 ---- deletea nil _ = (nil, false); ! deletea (bin K _ nil R ) Key = (R, true) if Key = K; ! deletea (bin K _ L nil) Key = (L, true) if Key = K; ! deletea (bin K B (bin KL BL RL LL) R) Key if Key = K: = adjustd LeftHasChanged (bin LK B NewL R) left where |
From: Albert G. <ag...@us...> - 2008-02-21 11:48:33
|
Update of /cvsroot/q-lang/q/stdlib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27157 Modified Files: dict.q Log Message: bugfixes Index: dict.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/dict.q,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dict.q 21 Feb 2008 09:18:55 -0000 1.9 --- dict.q 21 Feb 2008 11:48:29 -0000 1.10 *************** *** 161,166 **** where (NewR, RightHasChanged) = rmlasta R; - delete D Key = fst (deletea D Key); - deletea nil _ = (nil, false); deletea (bin Key _ _ nil R ) Key --- 161,164 ---- *************** *** 323,325 **** --- 321,326 ---- insert D:Dict (X,Y) = fst (inserta D X Y); + + delete D:Dict X = fst (deletea D X); + update D:Dict X Y = insert D (X,Y); |
From: Albert G. <ag...@us...> - 2008-02-21 09:18:59
|
Update of /cvsroot/q-lang/q/stdlib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28810 Modified Files: dict.q Log Message: bugfixes Index: dict.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/dict.q,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dict.q 21 Feb 2008 09:17:27 -0000 1.8 --- dict.q 21 Feb 2008 09:18:55 -0000 1.9 *************** *** 323,325 **** insert D:Dict (X,Y) = fst (inserta D X Y); ! update D:Dict KV = insert D KV; --- 323,325 ---- insert D:Dict (X,Y) = fst (inserta D X Y); ! update D:Dict X Y = insert D (X,Y); |
From: Albert G. <ag...@us...> - 2008-02-21 09:17:32
|
Update of /cvsroot/q-lang/q/stdlib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28395 Modified Files: dict.q Log Message: cosmetic changes Index: dict.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/dict.q,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dict.q 21 Feb 2008 09:03:07 -0000 1.7 --- dict.q 21 Feb 2008 09:17:27 -0000 1.8 *************** *** 283,289 **** emptydict = nil; ! dict Members:List = foldl insert emptydict Members; ! mkdict Val Keys:List = dict (zip Keys (mklist Val (#Keys))); #nil = 0; --- 283,289 ---- emptydict = nil; ! dict XYs:List = foldl insert emptydict XYs; ! mkdict Y Xs:List = dict (zip Xs (mklist Y (#Xs))); #nil = 0; *************** *** 299,326 **** D1:Dict <> D2:Dict = members D1 <> members D2; ! (bin K V _ L R)!Key = L!Key if Key < K; ! = R!Key if Key > K; ! = V; member nil _ = false; ! member (bin K _ _ L R) Key ! = member L Key if K > Key; ! = member R Key if K < Key; ! = true if K = Key; ! members nil = []; ! members (bin Key Val _ L R) = members L ++ [(Key, Val) | members R]; keys nil = []; ! keys (bin Key _ _ L R) = keys L ++ [Key | keys R]; vals nil = []; ! vals (bin _ Val _ L R) = vals L ++ [Val | vals R]; ! last (bin Key Val _ _ nil) = (Key, Val); ! last (bin _ _ _ _ R) = last R; ! first (bin Key Val _ nil _) = (Key, Val); ! first (bin _ _ _ L _) = first L; ! insert D:Dict (Key, Val) = fst (inserta D Key Val); update D:Dict KV = insert D KV; --- 299,325 ---- D1:Dict <> D2:Dict = members D1 <> members D2; ! (bin X Y _ D1 D2)!X1 = D1!X1 if X1 < X; ! = D2!X1 if X1 > X; ! = Y; member nil _ = false; ! member (bin X _ _ D1 D2) X1 = member D1 X1 if X > X1; ! = member D2 X1 if X < X1; ! = true if X = X1; ! members nil = []; ! members (bin X Y _ D1 D2) = members D1 ++ [(X,Y)|members D2]; keys nil = []; ! keys (bin X _ _ D1 D2) = keys D1 ++ [X|keys D2]; vals nil = []; ! vals (bin _ Y _ D1 D2) = vals D1 ++ [Y|vals D2]; ! last (bin X Y _ _ nil) = (X,Y); ! last (bin _ _ _ _ D2) = last D2; ! first (bin X Y _ nil _) = (X,Y); ! first (bin _ _ _ D1 _) = first D1; ! insert D:Dict (X,Y) = fst (inserta D X Y); update D:Dict KV = insert D KV; |
From: Albert G. <ag...@us...> - 2008-02-21 09:03:23
|
Update of /cvsroot/q-lang/q/stdlib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17251 Modified Files: bag.q dict.q hdict.q set.q Log Message: bugfixes Index: bag.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/bag.q,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** bag.q 21 Feb 2008 07:58:13 -0000 1.6 --- bag.q 21 Feb 2008 09:03:04 -0000 1.7 *************** *** 292,302 **** last (bin _ _ _ M2) = last M2 otherwise; ! rmlast Xs = fst (rmlasta Xs); ! rmfirst Xs = fst (rmfirsta Xs); ! insert Xs Y = fst (inserta Xs Y); ! delete Xs Y = fst (deletea Xs Y); /* bag comparison, union, difference and intersection: */ --- 292,302 ---- last (bin _ _ _ M2) = last M2 otherwise; ! rmlast M:Bag = fst (rmlasta M); ! rmfirst M:Bag = fst (rmfirsta M); ! insert M:Bag Y = fst (inserta M Y); ! delete M:Bag Y = fst (deletea M Y); /* bag comparison, union, difference and intersection: */ Index: hdict.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/hdict.q,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** hdict.q 21 Feb 2008 07:58:13 -0000 1.7 --- hdict.q 21 Feb 2008 09:03:07 -0000 1.8 *************** *** 341,345 **** emptyhdict = nil; hdict XYs:List = foldl insert nil XYs; ! mkhdict Y Xs = hdict (zip Xs (mklist Y (#Xs))); ishdict _:HDict = true; --- 341,345 ---- emptyhdict = nil; hdict XYs:List = foldl insert nil XYs; ! mkhdict Y Xs:List = hdict (zip Xs (mklist Y (#Xs))); ishdict _:HDict = true; Index: dict.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/dict.q,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dict.q 21 Feb 2008 07:58:13 -0000 1.6 --- dict.q 21 Feb 2008 09:03:07 -0000 1.7 *************** *** 285,289 **** dict Members:List = foldl insert emptydict Members; ! mkdict Val Keys = dict (zip Keys (mklist Val (#Keys))); #nil = 0; --- 285,289 ---- dict Members:List = foldl insert emptydict Members; ! mkdict Val Keys:List = dict (zip Keys (mklist Val (#Keys))); #nil = 0; *************** *** 323,326 **** first (bin _ _ _ L _) = first L; ! insert D (Key, Val) = fst (inserta D Key Val); ! update D KV = insert D KV; --- 323,326 ---- first (bin _ _ _ L _) = first L; ! insert D:Dict (Key, Val) = fst (inserta D Key Val); ! update D:Dict KV = insert D KV; Index: set.q =================================================================== RCS file: /cvsroot/q-lang/q/stdlib/set.q,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** set.q 21 Feb 2008 07:58:13 -0000 1.7 --- set.q 21 Feb 2008 09:03:08 -0000 1.8 *************** *** 293,303 **** last (bin _ _ _ M2) = last M2 otherwise; ! rmlast Xs = fst (rmlasta Xs); ! rmfirst Xs = fst (rmfirsta Xs); ! insert Xs Y = fst (inserta Xs Y); ! delete Xs Y = fst (deletea Xs Y); /* Set comparison, union, difference and intersection: */ --- 293,303 ---- last (bin _ _ _ M2) = last M2 otherwise; ! rmlast M:Set = fst (rmlasta M); ! rmfirst M:Set = fst (rmfirsta M); ! insert M:Set Y = fst (inserta M Y); ! delete M:Set Y = fst (deletea M Y); /* Set comparison, union, difference and intersection: */ |
From: Albert G. <ag...@us...> - 2008-02-21 08:25:48
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29512 Modified Files: NEWS Log Message: update NEWS Index: NEWS =================================================================== RCS file: /cvsroot/q-lang/q/NEWS,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** NEWS 16 Feb 2008 06:59:08 -0000 1.142 --- NEWS 21 Feb 2008 08:25:41 -0000 1.143 *************** *** 3,7 **** ======= ! * 7.11 16 February 2008 - As suggested by Rob Hubbard and John Cowan, special Unicode characters in --- 3,7 ---- ======= ! * 7.11 21 February 2008 - As suggested by Rob Hubbard and John Cowan, special Unicode characters in *************** *** 25,28 **** --- 25,40 ---- of new functions to retrieve additional metadata about a data source. + - Jiri Spitz also contributed a much improved AVL tree implementation for the + container types (bag.q, dict.q, hdict.q, set.q). The improved algorithm has + its origin in the SWI-Prolog implementation of association lists by + R.A.O'Keefe and Jan Wielemaker (see assoc.pl at http://www.swi-prolog.org). + Jiri rewrote the algorithm in Q and also added the deletion operations + which were missing in the Prolog version. Tests indicate that updating the + new data structures is at least twice at fast for large trees, quite a + notable improvement! + + Thanks to all who contributed code and participated in the discussions leading + up to this release! + ------------------------------------------------------------------------------ |
From: Albert G. <ag...@us...> - 2008-02-21 08:25:20
|
Update of /cvsroot/q-lang/q In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29432 Modified Files: ChangeLog Log Message: update ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/q-lang/q/ChangeLog,v retrieving revision 1.329 retrieving revision 1.330 diff -C2 -d -r1.329 -r1.330 *** ChangeLog 16 Feb 2008 06:58:43 -0000 1.329 --- ChangeLog 21 Feb 2008 08:25:16 -0000 1.330 *************** *** 1,5 **** ! 2008-02-16 Albert Graef <Dr....@t-...> ! + 7.11 * modules/odbc/odbc.c, odbc.q: add odbc_tables, odbc_columns, --- 1,20 ---- ! 2008-02-21 Albert Graef <Dr....@t-...> ! + 7.11 RC3 ! ! * stdlib/bag.q, dict.q, hdict.q, set.q: improved AVL tree ! implementation for the container types by Jiri Spitz ! ! The improved algorithm has its origin in the SWI-Prolog ! implementation of association lists by R.A.O'Keefe and Jan ! Wielemaker (see assoc.pl at http://www.swi-prolog.org). Jiri ! rewrote the algorithm in Q and also added the deletion operations ! which were missing in the Prolog version. While the original ! implementation (following Bird/Wadler) was more straightforward ! and looked a bit nicer, tests indicate that updating the new data ! structures is at least twice as fast for large trees, quite a ! notable improvement! ! ! 2008-02-16 Albert Graef <Dr....@t-...> * modules/odbc/odbc.c, odbc.q: add odbc_tables, odbc_columns, |