1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-06 07:30:28 +02:00
Commit graph

8572 commits

Author SHA1 Message Date
Mikael Djurfeldt
09841c7783 * configure.in: Test if pthread.h declares
pthread_mutexattr_settype ().
2002-12-16 09:25:48 +00:00
Mikael Djurfeldt
876235959d * threads.scm (par-map, par-for-each): Reimplemented using
joing-thread.
(parallel): Reimplemented using futures.
(n-par-map, n-for-each): New procedures.
2002-12-15 14:36:19 +00:00
Mikael Djurfeldt
28d52ebb19 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
Simply lock a thread C API recursive mutex.
(SCM_NONREC_CRITICAL_SECTION_START,
SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
SCM_REC_CRITICAL_SECTION_END): Removed.

* eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
direct calls to scm_rec_mutex_lock / unlock around the three calls
to scm_m_expand_body.

* eval.c, eval.h (promise_free): New function.
(scm_force): Rewritten;  Now thread-safe; Removed
SCM_DEFER/ALLOW_INTS.

* pthread-threads.h: Added partially implemented plugin interface
for recursive mutexes.  These are, for now, only intended to be
used internally within the Guile implementation.

* pthread-threads.c: New file.

* threads.c: Conditionally #include "pthread-threads.c".

* eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
thread-safe;

* snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
SCM_GLOBAL_REC_MUTEX): New macros.

* eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
macros---use mutexes instead.

* tags.h (SCM_IM_FUTURE): New tag.

* eval.c (scm_m_future): New primitive macro.
(SCM_CEVAL): Support futures.
(unmemocopy): Support unmemoization of futures.

* print.c (scm_isymnames): Name of future isym.
2002-12-15 14:24:34 +00:00
Mikael Djurfeldt
2ff4f18159 * version.c: Unmade some changes to my private copy that got
committed by mistake.
2002-12-15 11:27:01 +00:00
Marius Vollmer
edeea67b5a *** empty log message *** 2002-12-12 20:45:38 +00:00
Marius Vollmer
2a05206662 (improper-list-copy): New.
(parse-arglist): Use it instead of list-copy.
2002-12-12 20:43:11 +00:00
Mikael Djurfeldt
e200ddeeb2 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
2002-12-10.
2002-12-11 08:35:22 +00:00
Mikael Djurfeldt
392d2833a2 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
* gc.c (scm_gc_sweep): Call it here instead, which is a more
logical place.

* threads.c (create_thread): Remember root object until the handle
of the new thread is on all_threads list.

* root.c (scm_make_root): Moved copying of fluids until after
creation of root handle so that the fluids are GC protected.  Also
removed the critical section.
2002-12-11 06:54:59 +00:00
Mikael Djurfeldt
960c408c04 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
* gc-malloc.c (malloc_mutex): New mutex.
(scm_gc_malloc_prehistory): Initialize it.
(scm_realloc): Serialize call to realloc
(scm_calloc): Same for calloc.
Thanks to Wolfgang Jaehrling!
(Now we have to make sure all calls to malloc/realloc are made
through scm_malloc.)

* init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
2002-12-10 20:25:26 +00:00
Mikael Djurfeldt
3cdde9d667 * gc-malloc.c (malloc_mutex): New mutex.
(scm_gc_init_malloc): Initialize it.
(scm_realloc): Serialize call to realloc
(scm_calloc): Same for calloc.
Thanks to Wolfgang Jaehrling!
(Now we have to make sure all calls to malloc/realloc are made
through scm_malloc.)
2002-12-10 20:09:45 +00:00
Mikael Djurfeldt
5b5947a2b5 Removed incorrect comment. 2002-12-10 18:23:38 +00:00
Mikael Djurfeldt
ad280ae0a3 * configure.in (_THREAD_SAFE): Define when pthreads are enabled in
order to get thread safe versions of glibc functions.
2002-12-10 17:54:01 +00:00
Mikael Djurfeldt
094b640d77 (create_thread): Release heap before locking thread admin mutex. 2002-12-10 17:27:31 +00:00
Mikael Djurfeldt
c4c52ebe30 * threads.c (really_launch): Release heap (to prevent deadlock).
(create_thread): Release heap before locking thread admin mutex.
2002-12-10 16:51:14 +00:00
Mikael Djurfeldt
b0dc3d710a * threads.c (scm_i_thread_invalidate_freelists): New
function.

* gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
2002-12-10 16:09:37 +00:00
Mikael Djurfeldt
8c3300070b * modules.c (scm_export): Inserted a return statement. 2002-12-10 16:07:30 +00:00
Han-Wen Nienhuys
06e80f59f9 * modules.c (scm_export): new function
* gc-card.c: add a note about malloc()/free() overhead.
2002-12-10 13:26:25 +00:00
Mikael Djurfeldt
a12611c3e7 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
in srcdir.
2002-12-10 10:31:44 +00:00
Mikael Djurfeldt
c7fabadfe0 * async.c, error.h (scm_ints_disabled): Removed.
* gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
(old_ints): Removed.

* __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
critical section.
(SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
SCM_ALLOW_INTS.
2002-12-10 09:35:06 +00:00
Mikael Djurfeldt
06babeccd1 *** empty log message *** 2002-12-10 08:54:48 +00:00
Mikael Djurfeldt
52340b651a * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
Removed accidental #if 0 around these functions.
2002-12-09 19:27:44 +00:00
Mikael Djurfeldt
9bc4701cd3 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
(SCM_NONREC_CRITICAL_SECTION_START,
SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
SCM_REC_CRITICAL_SECTION_END): New macros.
(SCM_CRITICAL_SECTION_START/END): Defined here.

* eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
the three calls to scm_m_expand_body.

* gc.h: #include "libguile/pthread-threads.h";
(SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.

* gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
scm_t_key;

* gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
access.

* gc-freelist.c (scm_gc_init_freelist): Create freelist keys.

* gc-freelist.c, threads.c (really_launch): Use
SCM_FREELIST_CREATE.

* gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):

* gc.c (scm_i_expensive_validation_check, scm_gc,
scm_gc_for_newcell): Put threads to sleep before doing GC-related
heap administration so that those pieces of code are executed
single-threaded.  We might consider rewriting these code sections
in terms of a "call_gc_code_singly_threaded" construct instead of
calling the pair of scm_i_thread_put_to_sleep () and
scm_i_thread_wake_up ().  Also, we would want to have as many of
these sections eleminated.

* init.c (scm_init_guile_1): Call scm_threads_prehistory.

* inline.h: #include "libguile/threads.h"

* pthread-threads.h: Macros now conform more closely to the
pthreads interface.  Some of them now take a second argument.

* threads.c, threads.h: Many changes.

* configure.in: Temporarily replaced "copt" threads option with new
option "pthreads".
(USE_PTHREAD_THREADS): Define if pthreads configured.
2002-12-09 13:42:58 +00:00
Mikael Djurfeldt
fc85d09560 * threads.scm (letpar): New macro. 2002-12-09 12:58:52 +00:00
Rob Browning
9e6e154e84 * configure.in (GUILE_EFFECTIVE_VERSION): AC_SUBST it.
(AC_CONFIG_FILES): separate out the files that need to be chmodded
at the end of config.status.  Our "default" approach using
AC_CONFIG_COMMANDS quit working (and would have needed to be
changed to AC_CONFIG_COMMANDS(,,CMDS) rather than our previous
AC_CONFIG_COMMANDS(default,CMDS), but I the new approach, using
per-file AC_CONFIG_FILES calls appears to be more "correct" in the
current autoconf docs.
2002-12-09 00:52:03 +00:00
Rob Browning
b2cbe8d8a2 *** empty log message *** 2002-12-09 00:51:53 +00:00
Rob Browning
08f406b068 * GUILE-VERSION (GUILE_EFFECTIVE_VERSION): new variable. 2002-12-09 00:51:10 +00:00
Rob Browning
3d9782e928 * debugger/breakpoints/Makefile.am (subpkgdatadir): VERSION ->
GUILE_EFFECTIVE_VERSION.

* debugger/Makefile.am (subpkgdatadir): VERSION ->
GUILE_EFFECTIVE_VERSION.

* Makefile.am (subpkgdatadir): VERSION -> GUILE_EFFECTIVE_VERSION.
2002-12-09 00:50:34 +00:00
Rob Browning
717a0e5b8c * Makefile.am (ice9dir): VERSION -> GUILE_EFFECTIVE_VERSION. 2002-12-09 00:50:17 +00:00
Rob Browning
41d8c90a5e * configure.in (GUILE_EFFECTIVE_VERSION): AC_SUBST. 2002-12-09 00:50:10 +00:00
Rob Browning
467409e8db * scheme-options.texi (Build Config): add effective-version docs. 2002-12-09 00:49:52 +00:00
Rob Browning
13f6982bc2 * debugger/Makefile.am (subpkgdatadir): VERSION ->
GUILE_EFFECTIVE_VERSION.
2002-12-09 00:49:38 +00:00
Rob Browning
056eff7ccc * debugger/breakpoints/Makefile.am (subpkgdatadir): VERSION ->
GUILE_EFFECTIVE_VERSION.
2002-12-09 00:49:24 +00:00
Rob Browning
d8a20ddbfb * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
(libpath.h): use GUILE_EFFECTIVE_VERSION to compute
SCM_LIBRARY_DIR.
(version.h): generate this here rather than configure.in.  This
approach tracks source edits better (i.e. more immediately).
Might be worth considering for other .in files too.
2002-12-09 00:46:31 +00:00
Rob Browning
ccf01e3eaf * version.c (scm_effective_version): new function, also add
effective-version.
2002-12-09 00:46:24 +00:00
Rob Browning
020bc83889 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
(SCM_MINOR_VERSION): use @--@ substitution now.
(SCM_MICRO_VERSION): use @--@ substitution now.
(scm_effective_version): new function prototype.
2002-12-09 00:46:16 +00:00
Rob Browning
c0784b410b * Makefile.am (subpkgdatadir): VERSION -> GUILE_EFFECTIVE_VERSION. 2002-12-09 00:46:01 +00:00
Rob Browning
e50186ab08 * Makefile.am (subpkgdatadir): VERSION -> GUILE_EFFECTIVE_VERSION.
* goops/Makefile.am (subpkgdatadir): VERSION ->
GUILE_EFFECTIVE_VERSION.
2002-12-09 00:43:51 +00:00
Rob Browning
aad6f7db2c * goops/Makefile.am (subpkgdatadir): VERSION ->
GUILE_EFFECTIVE_VERSION.
2002-12-09 00:43:27 +00:00
Rob Browning
efb5821894 * Makefile.am (srfidir): VERSION -> GUILE_EFFECTIVE_VERSION. 2002-12-09 00:42:40 +00:00
Rob Browning
1844ae316e * tests/version.test: test (effective-version). 2002-12-09 00:42:18 +00:00
Mikael Djurfeldt
abce330ced * threads.scm (par-map, par-for-each, parallel):
* documentation.scm (object-documentation): Added support for
defmacros.
2002-12-04 22:06:15 +00:00
Marius Vollmer
2ab05d7843 *** empty log message *** 2002-12-02 01:18:31 +00:00
Marius Vollmer
d9d40de4ac (srfiinclude_HEADERS): Added srfi-1.h. 2002-12-02 01:18:20 +00:00
Marius Vollmer
931b9657a0 Changes to the thread sections. 2002-12-02 01:04:28 +00:00
Marius Vollmer
5441c65c48 *** empty log message *** 2002-12-02 01:03:24 +00:00
Marius Vollmer
b2635f91b7 (SUBDIRS): Removed qt. 2002-12-02 01:03:10 +00:00
Marius Vollmer
18622c4e84 Do not configure QTHREADS. Do not define USE_COOP_THREADS. Changed
logic for thread package selection so that the default is
"coop-pthread" when -lpthread is found, "null" otherwise.
2002-12-02 01:02:46 +00:00
Marius Vollmer
1d798a004a (SCM_VALIDATE_THREAD): Moved to threads.h. 2002-12-02 01:00:50 +00:00
Marius Vollmer
d823b11b10 * threads.h: Do not include "libguile/coop-defs.h". Include
"libguile/pthread-threads.h" for USE_COPT_THREADS.  Removed
(previously deprecated) C level thread API prototypes.  They are
now in the thread package specific headers, "null-threads.h" and
"pthread-threads.h".
(SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
New.
(scm_threads_init): Removed.
(SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
SCM_I_THREAD_SWITCH_COUNT): Define here.
(scm_single_thread_p): Removed.
(scm_call_with_new_thread): Take two args directly instead of list
of two args.
(scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
SCM_SET_THREAD_LOCAL_DATA): Define here.

* threads.c: Merged with "coop-pthreads.c".
2002-12-02 01:00:41 +00:00
Marius Vollmer
eac85310c2 * pthread-threads.h: New, implement pthread-like API by deferring to
pthread itself.
2002-12-02 01:00:20 +00:00