1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-04 05:50:26 +02:00
Commit graph

7169 commits

Author SHA1 Message Date
Mikael Djurfeldt
f4719f3191 * threads.scm (par-mapper, n-par-map, n-par-for-each): Use
futures.
2003-01-23 16:04:06 +00:00
Mikael Djurfeldt
77f9ca697e * libguile.h: #include "futures.h" 2003-01-23 16:03:46 +00:00
Mikael Djurfeldt
b4debead6a * threads.c (create_thread): Don't unwind dynwind chain of parent
thread before creation.  Just start the new thread with an empty
dynwind chain.
2003-01-22 10:29:28 +00:00
Mikael Djurfeldt
51407fa0b7 * occam-channel.scm (alt): New syntax. 2003-01-20 11:24:51 +00:00
Mikael Djurfeldt
93f26b7bcc * evalext.c, evalext.h (scm_self_evaluating_p): New function.
* psyntax.ss (self-evaluating?): Removed.  Guile now provides this
operator as a primitive procedure.
(build-data): Quote vectors (psyntax.ss requires this).
2003-01-20 10:12:39 +00:00
Mikael Djurfeldt
9889e923c6 * psyntax.ss (self-evaluating?): Allow procedures implanted in
source.  (Guile uses this internally.)
2003-01-19 17:47:01 +00:00
Mikael Djurfeldt
27b32aad49 * goops.scm (method): Construct a new copy of the constant '('())
for every macro invocation.
2003-01-18 19:07:38 +00:00
Mikael Djurfeldt
80f225df0e * psyntax.ss (build-data): Don't quote self-evaluating expressions
in output.  (We normally *would* like also these expressions to be
quoted, but until Guile's native macros and syncase cooperates
better, it is less destructive not to quote.)
(self-evaluating?): Removed null? (In Guile, the empty list is not
self-evaluating).
(sc-chi): Export chi as sc-chi.
(external-macro): New syntax type.

* psyntax.pp: Regenerated.

* compile-psyntax.scm: Set expansion-eval-closure.

* syncase.scm: Set expansion-eval-closure to
the-syncase-eval-closure during booting so that variables are
created in the correct module.
(syncase): Set expansion-eval-closure.
(define-syntax define-syntax-public eval-when fluid-let-syntax
identifier-syntax let-syntax letrec-syntax syntax syntax-case
syntax-rules with-syntax include): Removed definitions (these are
created from within psyntax.pp).
Enable expansion of Guile macros during a syntax-case
transformation.
2003-01-16 11:48:14 +00:00
Mikael Djurfeldt
cf743aeae6 * boot-9.scm (use-syntax): Return *unspecified*.
* syncase.scm: (syncase): Set expansion-eval-closure.
2003-01-15 20:35:25 +00:00
Mikael Djurfeldt
7906d57d02 * syncase.scm: Set expansion-eval-closure to
the-syncase-eval-closure during booting so that variables are
created in the correct module;
(define-syntax define-syntax-public eval-when fluid-let-syntax
identifier-syntax let-syntax letrec-syntax syntax syntax-case
syntax-rules with-syntax include): Removed definitions (these are
created from within psyntax.pp).
2003-01-15 17:29:09 +00:00
Mikael Djurfeldt
fb83145154 * occam-channel.scm (make-timer): New function. 2003-01-10 22:18:14 +00:00
Mikael Djurfeldt
41c96c3252 * threads.c (scm_timed_wait_condition_variable): Support timed
waiting also for simple condition variables.
2003-01-10 22:16:56 +00:00
Mikael Djurfeldt
8411a44631 * occam-channel.scm (make-channel): Renamed from channel. 2003-01-10 18:52:16 +00:00
Mikael Djurfeldt
60eefd9c3a * Makefile.am (ice9_sources): Added occam-channel.scm.
* occam-channel.scm: New file.  Implements occam-like channels.
2003-01-10 18:46:31 +00:00
Mikael Djurfeldt
38d8927ca8 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
of calling the procedure change-object-class.
2003-01-10 12:58:40 +00:00
Mikael Djurfeldt
da9015263e * goops.texi (Class Redefinition): Clarifications; Removed
mentioning of change-object-class.
2003-01-10 12:40:21 +00:00
Mikael Djurfeldt
9cf5d9b7d2 * ramap.c (scm_ramapc): Typo in error message. 2003-01-09 15:21:33 +00:00
Neil Jerram
2f413bc4bd Fix input/output port typo. 2003-01-08 21:36:20 +00:00
Mikael Djurfeldt
b46fae006d * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
slots with instance allocation.
2003-01-08 15:05:55 +00:00
Mikael Djurfeldt
bbf8d52350 * goops.scm (upgrade-generic-with-setter,
compute-new-list-of-methods): Use methods slot directly instead of
generic-function-methods.
(upgrade-generic-with-setter): Handle <extended-generic>:s.
(define-extended-generic): New syntax.
(make-extended-generic): New function.

* goops.c, goops.h (scm_class_extended_generic_with_setter): New
class.
(scm_compute_applicable_methods): Use scm_generic_function_methods.

* goops.c (scm_generic_function_methods): Support extended
generic functions.
2003-01-08 13:24:41 +00:00
Marius Vollmer
717bde134d *** empty log message *** 2003-01-06 20:10:12 +00:00
Marius Vollmer
298ddcca3a (elisp_sources): Added char-table.scm. 2003-01-06 20:10:03 +00:00
Mikael Djurfeldt
1767a0e0e9 * scheme-scheduling.texi (Low level thread primitives): Fixed typo
in broadcast-condition-variable.
2003-01-02 16:18:37 +00:00
Mikael Djurfeldt
dbe3008402 *** empty log message *** 2002-12-29 14:09:08 +00:00
Mikael Djurfeldt
2e37d6a2fc *** empty log message *** 2002-12-29 09:56:25 +00:00
Mikael Djurfeldt
ebf9b47c8b * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future. 2002-12-29 09:54:26 +00:00
Neil Jerram
14a9ba3f2c Remove commented-out declarations (related to Elisp). 2002-12-29 01:17:39 +00:00
Neil Jerram
db85376112 Add a hook that is run whenever a new module is defined. 2002-12-28 20:14:21 +00:00
Neil Jerram
6054d8052e Remove superfluous code (previously commented out). 2002-12-28 20:10:49 +00:00
Neil Jerram
c6a040a82a Code (work in progress, currently disabled) for reading Elisp-syntax vectors. 2002-12-28 19:57:14 +00:00
Neil Jerram
740a6d1a26 New stub definitions for char-table primitives. 2002-12-28 19:22:11 +00:00
Marius Vollmer
3742c12f5d *** empty log message *** 2002-12-26 15:00:50 +00:00
Marius Vollmer
93eaa2a224 (c-tokenize.o): Refer to source via $< so that vpath
builds work.
(EXTRA_DIST): Added version.h.in.
2002-12-26 15:00:23 +00:00
Mikael Djurfeldt
fb50ef08ec * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
* gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
scm_gc_register_collectable_memory): Substitute locking of
scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
(scm_igc): Lock sweep mutex here instead of in callers; Calls to
scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
the single-thread section (which now only contains the mark
phase).
(scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
Removed SCM_DEFER/ALLOW_INTS.  Simply call scm_igc directly.

* threads.c (gc_section_mutex): Removed.
2002-12-21 18:59:47 +00:00
Mikael Djurfeldt
0d48aca527 * threads.c (create_thread): Clear parent field in root state in
order not to unnecessarily remember dead threads.
2002-12-19 08:08:39 +00:00
Mikael Djurfeldt
b7b6a116e6 Added back two macros used when debugging. (Got lost by mistake during
a recent change.)
2002-12-19 08:00:23 +00:00
Mikael Djurfeldt
9ed246339f * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
(scm_trampoline_1, scm_trampoline_2): Use them.
2002-12-19 07:49:15 +00:00
Mikael Djurfeldt
b21dcf17d7 Fix 2002-12-18 14:15:11 +00:00
Mikael Djurfeldt
29717c8931 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
(EXTRA_DIST): Added threads-plugin.c.

* threads-plugin.h, threads-plugin.c: New files.

* threads.h: #include "libguile/threads-plugin.h".

* threads.c: #include "libguile/threads-plugin.c".

* pthread-threads.c: Temporarily remove debugging functions.

* threads.c, threads.h (scm_yield): Added back.
2002-12-18 13:42:58 +00:00
Mikael Djurfeldt
62d4fd94a6 * threads.scm: Removed bogus definition of future-ref. 2002-12-18 11:00:56 +00:00
Mikael Djurfeldt
e29e0b0963 * threads.c (really_launch): Detach before unlocking
thread_admin_mutex in order not to risk being joined.
(scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
thread_admin_mutex locked during GC.

* pthread-threads.c, pthread-threads.h: Improvements to debugging
functions.
2002-12-18 10:53:23 +00:00
Mikael Djurfeldt
dad981029a Fix... 2002-12-16 21:02:37 +00:00
Mikael Djurfeldt
6da2dfc4e0 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
support for debugging mutex operations.
2002-12-16 20:29:18 +00:00
Mikael Djurfeldt
0b6843b1eb * threads.c (scm_thread): Removed filed joining_threads.
(thread_print): Print thread number as well as address of thread
structure.
(scm_join_thread): Bugfix.
(scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
scm_timed_wait_condition_variable, scm_signal_condition_variable,
scm_broadcast_condition_variable): Use the low-level API.
(scm_all_threads): Return copy of thread list (to prevent
unintended destruction).
(scm_threads_prehistory): Initialize heap_mutex of fake thread.
2002-12-16 15:24:13 +00:00
Mikael Djurfeldt
1b92fb6b4d * threads.c (scm_thread): Removed filed joining_threads.
(thread_print): Print thread number as well as address of thread
structure.
2002-12-16 10:33:49 +00:00
Mikael Djurfeldt
dea5539eec * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
pthread "native" recursive mutex support.
2002-12-16 09:50:21 +00:00
Mikael Djurfeldt
93cd4dcd9c * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
pthread "native" recursive mutex support.
2002-12-16 09:28:38 +00:00
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