mit-scheme.git
9 years agogdbm: Assume other threads may run concurrently with the GC daemons.
Matt Birkholz [Fri, 10 Jul 2015 02:15:07 +0000 (19:15 -0700)]
gdbm: Assume other threads may run concurrently with the GC daemons.

9 years agoFor master: add with-thread-mutex-try-lock
Matt Birkholz [Fri, 10 Jul 2015 02:13:14 +0000 (19:13 -0700)]
For master: add with-thread-mutex-try-lock

9 years agoMore checking for no-current-thread.
Matt Birkholz [Thu, 9 Jul 2015 16:18:32 +0000 (09:18 -0700)]
More checking for no-current-thread.

9 years agoRemove call-with-current-thread.
Matt Birkholz [Thu, 9 Jul 2015 06:29:09 +0000 (23:29 -0700)]
Remove call-with-current-thread.

9 years agoCheck for no-current-thread. Lose condition-type.
Matt Birkholz [Thu, 9 Jul 2015 06:20:49 +0000 (23:20 -0700)]
Check for no-current-thread.  Lose condition-type.

9 years agoEliminate non-local exits from the thread system(?).
Matt Birkholz [Thu, 9 Jul 2015 00:36:52 +0000 (17:36 -0700)]
Eliminate non-local exits from the thread system(?).

9 years agoSerialize access to (runtime thread) internals.
Matt Birkholz [Wed, 8 Jul 2015 23:48:11 +0000 (16:48 -0700)]
Serialize access to (runtime thread) internals.

Multiple processors may use the thread system simultaneously, so
procedures that modify its data structures (or that just want to read
consistent data structures!) must arrange to serialize their accesses.
They must lock an OS-level mutex and unlock it when they are done, all
without-interrupts.  While the mutex is locked, they should NOT signal
errors nor invoke arbitrary hooks, handlers, etc.  Thus there should
be no need for a recursive mutex.

The nonrecursive mutex's atomic sections are implemented in uni-
processing worlds by masking all interrupts.  Inside, a LOCKED? flag
is set and cleared and asserts check that the thread system is locked
(or not!).  Allowing GC interrupts in these sections is left as an
exercise.

The channel-close and process-delete primitives are called inside the
thread system's atomic deregistration operations to ensure that the
timer interrupt or wait-for-io (i.e. test-select-registry called on
another processor) do not use the invalid descriptors.

9 years agoClobber fluid-let and the (runtime state-space) package.
Matt Birkholz [Wed, 8 Jul 2015 20:45:06 +0000 (13:45 -0700)]
Clobber fluid-let and the (runtime state-space) package.

UNimplement fluid-let using dynamic-wind as a backward compatibility
kludge.  Subsystems still using fluid-let, e.g. LIAR, must not be run
in multiple threads simultaneously.  Fluid-let no longer provides
thread-local storage.

Replace the uniprocessor-only Hanson/Lamping state-spaces with
Scheme48's multiprocessing-friendly dynamic-points in a new package
(runtime wind).

Replace the previously fluid-assigned bindings state-space:local and
(runtime dynamic)bindings with thread slots dynamic-point and dynamic-
environment.  Lose the error handling in wait-for-io; it runs when
there is no current thread, thus no way to bind-condition-handler.

9 years agoFix test-select-registry to "atomically" unmask interrupts.
Matt Birkholz [Sun, 5 Jul 2015 16:35:22 +0000 (09:35 -0700)]
Fix test-select-registry to "atomically" unmask interrupts.

When SMPing the machine cannot miss e.g a global-GC interrupt, else
the whole world grinds to a halt.  Using (set-interrupt-enables!
interrupt-mask/all) and then (test-select-registry ... #t) admits a
small "hole" wherein such an interrupt can drop, allowing the machine
to block without realizing it missed an interrupt intended to wake it.

The test-select-registry primitive does not actually "atomically
unmask interrupts" but simply ignores the mask inside its critical
section -- as if the mask was interrupt-mask/all.

Adjust branches so that, when not blocking, the simpler poll/select is
called (rather than ppoll/pselect).

Eliminate loops that re-try after masked interrupts arrive since all
interrupts are considered unmasked here.

9 years agoAdd register-gc-event, deregister-gc-event, registered-gc-event.
Matt Birkholz [Sun, 5 Jul 2015 16:31:11 +0000 (09:31 -0700)]
Add register-gc-event, deregister-gc-event, registered-gc-event.

Hook/record-statistic! is now a simple procedure or #F; it is no
longer a fluid.  With-gc-notification now uses dynamic-wind to
register and deregister a thread event for the current thread.

9 years agoReplace subprocess status ticks with thread events.
Matt Birkholz [Mon, 6 Jul 2015 06:26:34 +0000 (23:26 -0700)]
Replace subprocess status ticks with thread events.

Without without-interrupts, ticks do not work.  It is possible to
block even though a subprocess has changed state between the last
observation of the global status tick and the suspend.  Passing the
observed tick to suspend-current-thread would allow it to check for
new ticks in the atomic section wherein it decides if the thread
should suspend, but using with-thread-events-blocked for without-
interrupts suggests a "cleaner" solution: subprocess thread events.

The new procedures register-subprocess-event and deregister-
subprocess-event are now used by Edwin in SMPable worlds.  ANY main
loop managing subprocesses AND IO should be using register-subprocess-
event along with with-thread-events-blocked and suspend-current-thread
for SMPability.

Block-on-io-descriptor now uses with-thread-events-blocked instead of
without-interrupts but it does NOT use register-subprocess-event AND
WILL NOT UNBLOCK WHEN A SUBPROCESS CHANGES STATUS.

Unfortunately this breaks Edwin on OS2 and Win32 where it is now
possible for Edwin to block for keyboard input without noticing that a
subprocess has exited.  Edwin's main loop in these worlds needs to be
updated to use a "suspend loop" and register-subprocess-event even
though they do not actually multi-process.

Subprocess-wait now uses a suspend loop like the one in block-on-io-
descriptor rather than blocking for the rest of the thread's timeslice
in the process-wait primitive.  Synchronous subprocess management now
uses this procedure instead of the curious subprocess-wait* (the only
remaining procedure using ticks).

Thus SUBPROCESS-GLOBAL-STATUS-TICK and SUBPROCESS-STATUS-TICK are
eliminated.

Conflicts:
src/runtime/thread.scm

9 years agoReimplement permanently-register-io-thread-event for SMPability.
Matt Birkholz [Sat, 27 Jun 2015 22:24:45 +0000 (15:24 -0700)]
Reimplement permanently-register-io-thread-event for SMPability.

Remove permanent tentries (waiting thread entries) from
io-registrations.  Replace them with an event wrapper that loops,
re-registering after the wrapped event finishes.  The loop assumes IO
is being consumed during the event.  If not, it may spin forever.

Remove the notion of registering for the "front" of the queue too.

The X graphics device must take care to de-register its IO event
before closing the display, else the thread system may apply test-
select-registry to a closed descriptor.

9 years agoDo NOT use permanently-register-io-thread-event in Edwin.
Matt Birkholz [Sun, 5 Jul 2015 16:21:17 +0000 (09:21 -0700)]
Do NOT use permanently-register-io-thread-event in Edwin.

Edwin does not consume the IO in the thread event.  This worked in a
uni-processing world where another thread could consume the IO in
round-robin fashion, but in an SMPing world there is no way to know
when it is appropriate to signal another event.  In a naive
implementation (without special handling of these events), an idle
processor would spin, queuing MANY "IO ready" events to one thread
until another thread consumed the IO.

Edwin's X11 and console display types now block for IO on multiple
descriptors, the X or tty descriptor PLUS the subprocess output
descriptors.  They no longer use permanent IO thread events to handle
the latter.

Edwin's remaining uses of permanently-register-io-thread-event are in
single-threaded OS2 and Win32 worlds.  The runtime's only uses are in
the OS2 and X11 graphics devices where the IO *is* consumed during the
event.

9 years agoPunt unused variable slots and mention of dangerous bindings.
Matt Birkholz [Wed, 1 Jul 2015 15:03:48 +0000 (08:03 -0700)]
Punt unused variable slots and mention of dangerous bindings.

9 years agosrc/wabbit/README: typos
Matt Birkholz [Wed, 1 Jul 2015 15:01:11 +0000 (08:01 -0700)]
src/wabbit/README: typos

9 years agosvm: typo
Matt Birkholz [Tue, 23 Jun 2015 21:41:02 +0000 (14:41 -0700)]
svm: typo

9 years agodoc: The User Manual is for version 9.2.
Matt Birkholz [Wed, 1 Jul 2015 14:57:54 +0000 (07:57 -0700)]
doc: The User Manual is for version 9.2.

9 years agodoc: the dynamic context is the dynamic state
Matt Birkholz [Wed, 1 Jul 2015 14:56:57 +0000 (07:56 -0700)]
doc: the dynamic context is the dynamic state

And unparenthesize a sentence.

9 years agodoc/index.html: Factor out redundant words.
Matt Birkholz [Wed, 1 Jul 2015 14:54:06 +0000 (07:54 -0700)]
doc/index.html: Factor out redundant words.

9 years agodoc: Punt old and redundant discussion of constant space.
Matt Birkholz [Wed, 1 Jul 2015 14:53:08 +0000 (07:53 -0700)]
doc: Punt old and redundant discussion of constant space.

9 years agoRemove without-interrupts from runtime/process.scm.
Matt Birkholz [Tue, 23 Jun 2015 18:01:26 +0000 (11:01 -0700)]
Remove without-interrupts from runtime/process.scm.

Serial access to a subprocess is the responsibility of the user.  Thus
subprocess-i/o-port and close-subprocess-i/o do not need without-
interrupts to implement it.

Closing a port twice should not signal an error, so subprocess-delete
and close-subprocess-i/o do not need even without-interruption.
However they should close the port before clearing the subprocess
slot, else an abort could drop the port and it's channels may not be
closed for an arbitrarily long time.

Status sync could miss changes and subprocess-i/o-port and
make-subprocess could drop a subprocess or port if aborted mid-stride.
They now use without-interruption.

9 years agoRemove without-interrupts from runtime/x11graph.scm.
Matt Birkholz [Fri, 19 Jun 2015 20:22:48 +0000 (13:22 -0700)]
Remove without-interrupts from runtime/x11graph.scm.

Replaced it with without-interruption.  Presumably the desire was to
keep the permanently registered IO thread event from interrupting
itself.

9 years agoRemove without-interrupts from runtime/random.scm.
Matt Birkholz [Fri, 19 Jun 2015 17:51:15 +0000 (10:51 -0700)]
Remove without-interrupts from runtime/random.scm.

Use a mutex to serialize access to the default random state.  Serial
access to other random states is still the responsibility of the user.

9 years agoRemove without-interrupts from runtime/queue.scm.
Matt Birkholz [Fri, 19 Jun 2015 20:04:04 +0000 (13:04 -0700)]
Remove without-interrupts from runtime/queue.scm.

Add make-serial-queue and use it in runtime globals: the event
distributors, GC daemons and REPLs.  Note that the "safe" queue
operations, when applied to non-serializing queues in SMPing worlds,
are NOT thread-safe.  This only happens in LIAR, SWAT, Edwin, X11
Graphics and OS2 Graphics -- single-threaded applications.

9 years agoSerialize access to the population-of-1d-tables.
Matt Birkholz [Wed, 1 Jul 2015 14:34:59 +0000 (07:34 -0700)]
Serialize access to the population-of-1d-tables.

Allow create-thread to be run by multiple threads concurrently while
still accessing the population-of-1d-tables serially.

9 years agoRemove without-interrupts from runtime/io.scm.
Matt Birkholz [Thu, 18 Jun 2015 23:55:06 +0000 (16:55 -0700)]
Remove without-interrupts from runtime/io.scm.

Channel-read and channel-write used without-interrupts for atomicity,
to avoid calling primitives with a channel another thread has closed.
The resulting errors may have been expensive to handle, but the cheap
technique of calling without-interrupts is ineffective in SMPing
worlds.  Assuming most channels are used by one thread and will not
encounter these errors, just punt the calls to without-interrupts.

Serialize modifications to the channel table (esp. channel-close) via
the open-channels gc finalizer's atomic section and the new
with-gc-finalizer-lock procedure.

Remove tty-input-channel and tty-output-channel from general use.
They are only used in a cold load initialize-package! procedure and an
after-restore reset-console procedure.  They are not fit for general
use, creating a new channel object each time they are called, only the
newest one of which is returned by descriptor->channel.  Assume these
procedures are only used in single threaded fashion.

In open-pty-master, directory-channel-open and make-select-registry,
replace without-interrupts with without-interruption to avoid dropping
a channel or registry because of an inopportune abort.  GC finalizers
like open-channels and open-directories (and select-registry-
finalizer) are already serializing.

Do NOT export channel-descriptor-for-select to the () package.  Assume
select registries and their result vectors are used ONLY internally,
in single threaded fashion, by the thread system.  Punt the
unnecessary and now useless calls to without-interrupts.

In dld-load-file and dld-unload-file, serialize access to the
dld-handles via dld-handles-mutex.

9 years agoRemove without-interrupts from runtime/infutl.scm.
Matt Birkholz [Tue, 23 Jun 2015 23:01:51 +0000 (16:01 -0700)]
Remove without-interrupts from runtime/infutl.scm.

Without-interrupts was used to make atomic accesses to the
uncompressed-files cache and the wrappers-with-memoized-debugging-info
population.  To replace it, a serial population is used and the
uncompressed-files cache is punted.  The latter is hopefully
unnecessary on modern machinery.

9 years agoRemove without-interrupts from runtime/hashtb.scm.
Matt Birkholz [Thu, 18 Jun 2015 19:23:48 +0000 (12:23 -0700)]
Remove without-interrupts from runtime/hashtb.scm.

Serial access to particular hash tables is (now?) the responsibility
of the user -- all access, not just modifications (because of lazy
rehashing).  Serial access to the list of all address hash tables is
now the responsiblity of a serial population.

Most calls to with-table-locked! (aka without-interrupts) are now
calls to without-interruption (to postpone inopportune aborts).

9 years agoRemove with-absolutely-no-interrupts from runtime/hash.scm.
Matt Birkholz [Thu, 18 Jun 2015 19:56:42 +0000 (12:56 -0700)]
Remove with-absolutely-no-interrupts from runtime/hash.scm.

Use a thread mutex to serialize access.  Simplify an ancient
implementation by using the new datum weak and key weak hash table
types. Initialize the package AFTER (runtime hash-table).

9 years agoRemove without-interrupts from runtime/global.scm.
Matt Birkholz [Mon, 6 Jul 2015 01:25:35 +0000 (18:25 -0700)]
Remove without-interrupts from runtime/global.scm.

Clean-obarray runs as a secondary-gc-deamon and thus, in SMPing
worlds, it may run in parallel with other threads on other processors.

A number of primitives and compiler utilities modify the obarray so an
SMPing microcode will use a pthread mutex to serialize access to it.
Clean-obarray now uses a new procedure, with-system-obarray-lock, that
uses new primitives to participate in the serialization.

Remove limit-interrupts!.  Like without-interrupts, it will not work
as expected in SMPing worlds.

9 years agoRemove without-interrupts from runtime/generic.scm.
Matt Birkholz [Fri, 19 Jun 2015 17:31:37 +0000 (10:31 -0700)]
Remove without-interrupts from runtime/generic.scm.

Serial access to particular generic functions is still the
responsibility of the user.  Serial access to the
generic-procedure-records table is now ensured by a thread mutex.

9 years agoRemove without-interrupts from runtime/geneqht.scm.
Matt Birkholz [Thu, 18 Jun 2015 18:24:43 +0000 (11:24 -0700)]
Remove without-interrupts from runtime/geneqht.scm.

Serial access to a particular table is still the responsibility of the
user (e.g. SOS procedures?), but the list of all address hash tables
is now a serial population.

9 years agoAdd make-serial-population.
Matt Birkholz [Thu, 18 Jun 2015 18:22:42 +0000 (11:22 -0700)]
Add make-serial-population.

Also add empty-population! and for-each-inhabitant.

Do not export the /unsafe procedures even to (runtime); require that
they be explicitly imported (specifically exported?).  Use the /unsafe
procedures in (runtime 1d-property) and (runtime thread) package
initializations to avoid trying to lock the population-of-populations
too early in the cold load.

9 years agoRemove without-interrupts from runtime/gcfinal.scm.
Matt Birkholz [Thu, 18 Jun 2015 18:21:09 +0000 (11:21 -0700)]
Remove without-interrupts from runtime/gcfinal.scm.

Serialize access to the list of gc finalizers and to each finalizer.

9 years agoInitialize the thread system early in the cold load.
Matt Birkholz [Mon, 6 Jul 2015 00:58:03 +0000 (17:58 -0700)]
Initialize the thread system early in the cold load.

Thus with-thread-mutex-lock can be used during initialization of most
packages.  Avoid using the global set-interrupt-enables! binding in
dynamic-wind because it is now called so early.

This anticipates removing without-interrupts from gcfinal.scm and thus
calling with-thread-mutex-lock during make-gc-finalizer, e.g. during
the initialization of the (runtime string) package.

9 years agoRemove with-absolutely-no-interrupts from runtime/gc.scm.
Matt Birkholz [Tue, 23 Jun 2015 18:42:13 +0000 (11:42 -0700)]
Remove with-absolutely-no-interrupts from runtime/gc.scm.

Default/purify and default/gc-flip modified the constant-space-queue
under the cover of with-absolutely-no-interrupts, which is no longer
atomic.  Serializing these procedures is a trick because the latter is
invoked by the GC interrupt.  (Thus ABSOLUTELY no interrupts were
allowed?)

But there is no need for default/gc-flip to remove items from the
queue.  Flush-purification-queue! will know that its queue is "empty"
when its head is in constant space.  Thus the interrupt no longer
modifies the queue, and the queuing process is serialized in the usual
way.

Since primitive-purify cannot fail for lack of space, ancient error
signals and retry loops are also eliminated.

9 years agoDefine make-thread-mutex early.
Matt Birkholz [Wed, 17 Jun 2015 03:03:56 +0000 (20:03 -0700)]
Define make-thread-mutex early.

Global data structures like event-distributors and gc-daemon queues
need to serialize operations and could use thread mutexes except that
they are naturally created early in the cold load, before the thread
system is loaded.  So the mutex data structure is defined (withOUT
define-structure syntax) in a new file: runtime/thread-low.scm.  The
rest of thread.scm must be loaded after record.scm.

This breaks the circularity where thread system initialization
requires population and 1d-table operations which are serialized by
the thread system.

9 years agoRemove without-interrupts from runtime/sfile.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:35:31 +0000 (19:35 -0700)]
Remove without-interrupts from runtime/sfile.scm.

Serialize access to the files-to-delete element of the fixed-objects
vector.

9 years agoRemove without-interrupts from runtime/rgxcmp.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:34:03 +0000 (19:34 -0700)]
Remove without-interrupts from runtime/rgxcmp.scm.

Add a mutex to each of the memoization caches.

9 years agoRemove without-interrupts from runtime/ffi.scm (mostly).
Matt Birkholz [Wed, 17 Jun 2015 02:26:59 +0000 (19:26 -0700)]
Remove without-interrupts from runtime/ffi.scm (mostly).

Modifications to the registered-callbacks vector and the malloced
aliens list are now serialized by mutexes.  Call-alien still needs
without-interrupts.  It must avoid preemption during a callback.

9 years agoRemove without-interrupts from runtime/string.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:21:46 +0000 (19:21 -0700)]
Remove without-interrupts from runtime/string.scm.

It was only used to postpone aborts that would drop an external string
descriptor.  The interrupt mask manipulation in %string-head! only
postpones a GC flip while the local heap is edited.

9 years agoRemove without-interrupts from runtime/rbtree.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:21:19 +0000 (19:21 -0700)]
Remove without-interrupts from runtime/rbtree.scm.

It was only used to postpone aborts that would leave data structures
inconsistent.

9 years agoUnalias with-absolutely-no-interrupts in runtime/prgcop.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:20:31 +0000 (19:20 -0700)]
Unalias with-absolutely-no-interrupts in runtime/prgcop.scm.

It is not atomic in multiprocessing worlds.  The alias "atomically" is
no longer appropriate.

9 years agoRemove without-interrupts from runtime/parser-buffer.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:18:21 +0000 (19:18 -0700)]
Remove without-interrupts from runtime/parser-buffer.scm.

It was only used to postpone aborts that would leave data structures
inconsistent.

9 years agoRemove without-interrupts from runtime/gencache.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:16:21 +0000 (19:16 -0700)]
Remove without-interrupts from runtime/gencache.scm.

It was only used to postpone aborts that would leave data structures
inconsistent.  Access to these caches needs to be serial.

9 years agoRemove without-interrupts from runtime/gdbm.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:15:57 +0000 (19:15 -0700)]
Remove without-interrupts from runtime/gdbm.scm.

It was only used to postpone aborts that would leak gdbfs.

9 years agoRemove without-interrupts from runtime/crypto.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:15:05 +0000 (19:15 -0700)]
Remove without-interrupts from runtime/crypto.scm.

It was only used to postpone aborts that would leak mhash contexts.

9 years agoRemove without-interrupts from runtime/condvar.scm.
Matt Birkholz [Wed, 17 Jun 2015 02:13:46 +0000 (19:13 -0700)]
Remove without-interrupts from runtime/condvar.scm.

Multi-threaded access to the chain of waiters is already adequately
serialized by the condition-variable.lock.  Without-interrupts was
only intended to postpone aborts that would leave a doubly-linked
chain without a complete pair of links.

9 years agoAdd without-interruption, to replace without-interrupts...
Matt Birkholz [Wed, 17 Jun 2015 02:05:24 +0000 (19:05 -0700)]
Add without-interruption, to replace without-interrupts...

...where atomicity is not needed.  Without-interrupts is deprecated
because it is broken in multiprocessing worlds where it cannot provide
the atomicity it guarantees in uniprocessing worlds.

9 years agodebug.c: Add a get-interrupt-code primitive.
Matt Birkholz [Wed, 17 Jun 2015 02:01:19 +0000 (19:01 -0700)]
debug.c: Add a get-interrupt-code primitive.

9 years agodebug.c (print_string): Summarize long strings.
Matt Birkholz [Wed, 17 Jun 2015 01:56:30 +0000 (18:56 -0700)]
debug.c (print_string): Summarize long strings.

9 years agoMark with-thread-events-blocked stack frames with the symbol.
Matt Birkholz [Sat, 6 Jun 2015 00:51:33 +0000 (17:51 -0700)]
Mark with-thread-events-blocked stack frames with the symbol.

These frames can then be recognized in Debug_Stack_Trace output.

9 years agoFix another typo in commit 2a447ff.
Matt Birkholz [Mon, 6 Jul 2015 05:41:27 +0000 (22:41 -0700)]
Fix another typo in commit 2a447ff.

9 years agoFix typo in commit 2a447ff.
Matt Birkholz [Mon, 6 Jul 2015 01:21:25 +0000 (18:21 -0700)]
Fix typo in commit 2a447ff.

9 years agoFix VECTOR-8B->HEXADECIMAL/UPPERCASE test.
Taylor R Campbell [Sun, 5 Jul 2015 17:41:11 +0000 (17:41 +0000)]
Fix VECTOR-8B->HEXADECIMAL/UPPERCASE test.

9 years agoAdd error checking to entity and apply hook operations.
Taylor R Campbell [Sun, 5 Jul 2015 17:39:59 +0000 (17:39 +0000)]
Add error checking to entity and apply hook operations.

9 years agoNo recursion needed: use WITH-THREAD-MUTEX-LOCK.
Taylor R Campbell [Tue, 9 Jun 2015 04:22:11 +0000 (04:22 +0000)]
No recursion needed: use WITH-THREAD-MUTEX-LOCK.

9 years agoNo recursion needed: use WITH-THREAD-MUTEX-LOCK.
Taylor R Campbell [Tue, 9 Jun 2015 04:22:07 +0000 (04:22 +0000)]
No recursion needed: use WITH-THREAD-MUTEX-LOCK.

9 years agoNo recursion needed: use WITH-THREAD-MUTEX-LOCK.
Taylor R Campbell [Tue, 9 Jun 2015 04:22:01 +0000 (04:22 +0000)]
No recursion needed: use WITH-THREAD-MUTEX-LOCK.

9 years agoNo recursion needed: use WITH-THREAD-MUTEX-LOCK.
Taylor R Campbell [Tue, 9 Jun 2015 04:21:50 +0000 (04:21 +0000)]
No recursion needed: use WITH-THREAD-MUTEX-LOCK.

9 years agoNo recursion needed: use WITH-THREAD-MUTEX-LOCK.
Taylor R Campbell [Tue, 9 Jun 2015 04:21:41 +0000 (04:21 +0000)]
No recursion needed: use WITH-THREAD-MUTEX-LOCK.

9 years agoNew WITH-THREAD-MUTEX-LOCKED rejects recursion like LOCK-THREAD-MUTEX.
Taylor R Campbell [Tue, 9 Jun 2015 04:21:20 +0000 (04:21 +0000)]
New WITH-THREAD-MUTEX-LOCKED rejects recursion like LOCK-THREAD-MUTEX.

9 years agoRevert "Remove support for recursion in WITH-THREAD-MUTEX-LOCKED."
Taylor R Campbell [Tue, 9 Jun 2015 03:44:38 +0000 (03:44 +0000)]
Revert "Remove support for recursion in WITH-THREAD-MUTEX-LOCKED."

This reverts commit d7241d6fe8b151f6d15db9cac8fba44b074ca215.

Evidently people did rely on this.

9 years agoUse logarithmic balancing rather than bounded balancing for wttree.
Taylor R Campbell [Sun, 3 May 2015 03:04:40 +0000 (03:04 +0000)]
Use logarithmic balancing rather than bounded balancing for wttree.

9 years agoFactor out wttree balancing criteria.
Taylor R Campbell [Sun, 3 May 2015 00:05:05 +0000 (00:05 +0000)]
Factor out wttree balancing criteria.

9 years agoAdd vector-8b<->hexadecimal tests.
Taylor R Campbell [Sun, 3 May 2015 00:03:44 +0000 (00:03 +0000)]
Add vector-8b<->hexadecimal tests.

9 years agoFix hexadecimal->vector-8b for real.
Taylor R Campbell [Sun, 3 May 2015 00:04:31 +0000 (00:04 +0000)]
Fix hexadecimal->vector-8b for real.

10 years agoAdd outf_error_line; use it everywhere.
Matt Birkholz [Fri, 19 Dec 2014 17:32:04 +0000 (10:32 -0700)]
Add outf_error_line; use it everywhere.

Use it for brevity.  Later when each outf_ operation involves grabbing
a mutex, use it for efficiency.

10 years agoFix Do_Micro_Error to respect stack direction, and print arguments.
Matt Birkholz [Fri, 19 Dec 2014 17:05:34 +0000 (10:05 -0700)]
Fix Do_Micro_Error to respect stack direction, and print arguments.

10 years agoUse INTERRUPTABLE_EXTENT in OS_pause when !HAVE_SIGSUSPEND.
Matt Birkholz [Fri, 19 Dec 2014 16:56:32 +0000 (09:56 -0700)]
Use INTERRUPTABLE_EXTENT in OS_pause when !HAVE_SIGSUSPEND.

10 years agoJust warn when set-debug-flags! is used on a non-debugging machine.
Matt Birkholz [Fri, 19 Dec 2014 16:54:31 +0000 (09:54 -0700)]
Just warn when set-debug-flags! is used on a non-debugging machine.

10 years agodoc: Clean up doc-config.scm.
Matt Birkholz [Fri, 12 Dec 2014 17:02:35 +0000 (10:02 -0700)]
doc: Clean up doc-config.scm.

10 years agodoc: Configure --disable-* should disable build as well as install.
Matt Birkholz [Fri, 12 Dec 2014 17:01:53 +0000 (10:01 -0700)]
doc: Configure --disable-* should disable build as well as install.

Add a TARGETS variable to collect ENabled targets, like INST_TARGETS.

10 years agoTweak condition variable locking.
Taylor R Campbell [Mon, 17 Nov 2014 06:04:26 +0000 (06:04 +0000)]
Tweak condition variable locking.

- Use WITH-THREAD-MUTEX-LOCKED.
- Use ASSERT-THREAD-MUTEX-OWNED.

No functional changes intended.

10 years agoAllow thread barriers to be named.
Taylor R Campbell [Sun, 16 Nov 2014 20:25:27 +0000 (20:25 +0000)]
Allow thread barriers to be named.

10 years agoShow the condition, not just its report, in derived condition reports.
Taylor R Campbell [Sun, 16 Nov 2014 20:24:42 +0000 (20:24 +0000)]
Show the condition, not just its report, in derived condition reports.

That way you can (debug #@n) it or M-x browse-continuation it.

10 years agoFix timed condition variable waits.
Taylor R Campbell [Sun, 16 Nov 2014 18:53:41 +0000 (18:53 +0000)]
Fix timed condition variable waits.

10 years agoSternly advise against non-debugging use of THREAD-MUTEX-OWNER.
Taylor R Campbell [Sun, 16 Nov 2014 18:53:28 +0000 (18:53 +0000)]
Sternly advise against non-debugging use of THREAD-MUTEX-OWNER.

10 years agoRemove support for recursion in WITH-THREAD-MUTEX-LOCKED.
Taylor R Campbell [Sun, 16 Nov 2014 18:52:58 +0000 (18:52 +0000)]
Remove support for recursion in WITH-THREAD-MUTEX-LOCKED.

10 years agoDon't let just any event wake THREAD-JOIN.
Taylor R Campbell [Fri, 14 Nov 2014 04:47:04 +0000 (04:47 +0000)]
Don't let just any event wake THREAD-JOIN.

10 years agoSort names in (runtime thread) package.
Taylor R Campbell [Fri, 14 Nov 2014 04:19:05 +0000 (04:19 +0000)]
Sort names in (runtime thread) package.

10 years agoRename GUARANTEE-THREAD-MUTEX-OWNED to ASSERT-THREAD-MUTEX-OWNED.
Taylor R Campbell [Fri, 14 Nov 2014 04:18:27 +0000 (04:18 +0000)]
Rename GUARANTEE-THREAD-MUTEX-OWNED to ASSERT-THREAD-MUTEX-OWNED.

10 years agoFluidize hook/exit and hook/quit. Add hook/%exit for Edwin.
Matt Birkholz [Thu, 13 Nov 2014 22:22:03 +0000 (15:22 -0700)]
Fluidize hook/exit and hook/quit.  Add hook/%exit for Edwin.

Replace the fluid-let in src/edwin/intmod.scm with let-fluids.  The
fluid-let kludge in SMP worlds causes Edwin to hang when killed.

10 years agoUnfluidize (runtime boot-definitions) internal boot-inits.
Matt Birkholz [Thu, 13 Nov 2014 22:25:29 +0000 (15:25 -0700)]
Unfluidize (runtime boot-definitions) internal boot-inits.

Replace the fluid-let with its expansion into a dynamic-wind, which
works only if the bootstrap proceeds in one thread and thus
thread-local values for boot-inits are not needed.

10 years agoruntime/thread-queue.scm: Use a mutex to serialize accesses.
Matt Birkholz [Thu, 13 Nov 2014 22:59:23 +0000 (15:59 -0700)]
runtime/thread-queue.scm: Use a mutex to serialize accesses.

Also, use #f events.  The (lambda () unspecific) events accumulate
unnecessarily.

10 years agosvm: Make the trap handlers static.
Matt Birkholz [Thu, 13 Nov 2014 23:03:08 +0000 (16:03 -0700)]
svm: Make the trap handlers static.

I won't vouch for any speed improvement.  I just noticed all the
others were declared static.

10 years agoetc/usermap: Update my email address.
Matt Birkholz [Thu, 13 Nov 2014 23:01:11 +0000 (16:01 -0700)]
etc/usermap: Update my email address.

10 years agoQuiet the last CREF complaint on Unix.
Matt Birkholz [Wed, 22 Oct 2014 23:12:31 +0000 (16:12 -0700)]
Quiet the last CREF complaint on Unix.

Convert references to compiler global variables into
environment-lookup combinations.

10 years agoAdd bindings to edwin/debug.scm; punt browser-evaluator.
Matt Birkholz [Wed, 22 Oct 2014 23:01:30 +0000 (16:01 -0700)]
Add bindings to edwin/debug.scm; punt browser-evaluator.

Add ansi.scm to (edwin screen console-screen) for unix as well as
dos and nt.  This quiets cref's complaint about termcap.scm's
reference to make-ansi-terminal-description.

The browser-evaluator command was never implemented(?).

10 years agoSyntax sf before compiler.
Matt Birkholz [Wed, 22 Oct 2014 22:58:11 +0000 (15:58 -0700)]
Syntax sf before compiler.

The trivial package model of (scode-optimizer) does not include the
internal bindings needed when analyzing (compiler).

10 years agoMove compile-directory. Punt sf- and compile-directory?.
Matt Birkholz [Thu, 23 Oct 2014 07:58:41 +0000 (00:58 -0700)]
Move compile-directory.  Punt sf- and compile-directory?.

Sf-directory? and friend appear to have been broken since
directory-processor started expecting output-type to be a thunk.

Moving compile-directory out of sf/butils.scm and into
compiler/base/toplev.scm eliminates free variable references noted by
CREF.

10 years agoAdd thread barrier abstraction.
Taylor R Campbell [Thu, 13 Nov 2014 22:59:36 +0000 (22:59 +0000)]
Add thread barrier abstraction.

10 years agoAdd condition variable abstraction.
Taylor R Campbell [Thu, 13 Nov 2014 22:55:16 +0000 (22:55 +0000)]
Add condition variable abstraction.

10 years agoAdd GUARANTEE-THREAD-MUTEX-OWNED.
Taylor R Campbell [Thu, 13 Nov 2014 22:45:03 +0000 (22:45 +0000)]
Add GUARANTEE-THREAD-MUTEX-OWNED.

10 years agoInherit the root thread continuation.
Taylor R Campbell [Thu, 6 Nov 2014 01:39:15 +0000 (01:39 +0000)]
Inherit the root thread continuation.

Fixes
<http://lists.gnu.org/archive/html/mit-scheme-devel/2012-04/msg00000.html>:
nested CREATE-THREADs sometimes see an unassigned root continuation.

10 years agoFix indentation in GET-X-DISPLAY botched by last commit.
Taylor R Campbell [Tue, 4 Nov 2014 04:29:42 +0000 (04:29 +0000)]
Fix indentation in GET-X-DISPLAY botched by last commit.

10 years agoReset Edwin's X display on restore.
Taylor R Campbell [Mon, 3 Nov 2014 20:43:44 +0000 (20:43 +0000)]
Reset Edwin's X display on restore.

It now works to save and restore bands in which you have run Edwin
with X, as long as Edwin is not currently running while you save the
band.

10 years agoCall dload_finalize_file, not dld_finalize_file. Oops.
Taylor R Campbell [Mon, 3 Nov 2014 20:43:34 +0000 (20:43 +0000)]
Call dload_finalize_file, not dld_finalize_file.  Oops.

10 years agoReset dld (.so) handles on restore.
Taylor R Campbell [Mon, 3 Nov 2014 20:43:17 +0000 (20:43 +0000)]
Reset dld (.so) handles on restore.

10 years agoDon't pass `-isysroot -fconstant-cfstrings' if we can't find OS X SDKs.
Taylor R Campbell [Tue, 21 Oct 2014 21:09:11 +0000 (21:09 +0000)]
Don't pass `-isysroot -fconstant-cfstrings' if we can't find OS X SDKs.