mit-scheme.git
8 years agoMerge branch 'Gtk-Screen' into Gtk. End the Gtk-Screen branch!
Matt Birkholz [Sat, 6 Feb 2016 18:31:17 +0000 (11:31 -0700)]
Merge branch 'Gtk-Screen' into Gtk.  End the Gtk-Screen branch!

The only conflict was caused by unwinding and re-committing the patch
for src/gtk/swat-pole-zero AFTER it was merged with Gtk-Screen.

8 years agoAdd set-rectangle-ink-position./linux-3735fd4-2/bin/mit-scheme --load debug
Matt Birkholz [Sat, 6 Feb 2016 18:26:26 +0000 (11:26 -0700)]
Add set-rectangle-ink-position./linux-3735fd4-2/bin/mit-scheme --load debug

8 years agoMerge 'Gtk' into Gtk-Screen.
Matt Birkholz [Sat, 6 Feb 2016 18:17:49 +0000 (11:17 -0700)]
Merge 'Gtk' into Gtk-Screen.

8 years agoChain TAGS files via includes: gtk > cairo > pango > glib > sos,9.2.
Matt Birkholz [Fri, 5 Feb 2016 23:51:59 +0000 (16:51 -0700)]
Chain TAGS files via includes: gtk > cairo > pango > glib > sos,9.2.

8 years agogtk/swat-pole-zero: Quiet warnings about unimplemented colors,fonts.
Matt Birkholz [Sat, 6 Feb 2016 17:07:37 +0000 (10:07 -0700)]
gtk/swat-pole-zero: Quiet warnings about unimplemented colors,fonts.

Fill unit circle with canvas-color.

8 years agoChain TAGS files via includes: gtk > cairo > pango > glib > sos,9.2.
Matt Birkholz [Fri, 5 Feb 2016 23:51:59 +0000 (16:51 -0700)]
Chain TAGS files via includes: gtk > cairo > pango > glib > sos,9.2.

8 years agogtk/swat-pole-zero: Quiet warnings about colors and fonts.
Matt Birkholz [Fri, 5 Feb 2016 23:21:02 +0000 (16:21 -0700)]
gtk/swat-pole-zero: Quiet warnings about colors and fonts.

Fill unit circle with canvas-color.

8 years agoRemove <box-ink> (gtk_render_focus), the last stylish ink.
Matt Birkholz [Fri, 5 Feb 2016 22:19:30 +0000 (15:19 -0700)]
Remove <box-ink> (gtk_render_focus), the last stylish ink.

Use a rectangle ink in the demo instead.

It is too hard to calculate a stylish ink's extent, because it depends
on the style context -- the current theme's colors, line widths, etc.

8 years agoMerge branch 'master' into Gtk.
Matt Birkholz [Thu, 4 Feb 2016 04:36:08 +0000 (21:36 -0700)]
Merge branch 'master' into Gtk.

8 years agosrc/etc/compile-svm.sh: Use max heap to cross-compile on i386.
Matt Birkholz [Thu, 4 Feb 2016 04:25:08 +0000 (21:25 -0700)]
src/etc/compile-svm.sh: Use max heap to cross-compile on i386.

Running the secondary GC daemons after compiling a directory helps,
but 10000KiW is still too small.  Cross-compilation of edwin/snr hangs
unless 12000KiW can be had.

8 years agoAbort the console thread when heap is low.
Matt Birkholz [Thu, 4 Feb 2016 04:23:25 +0000 (21:23 -0700)]
Abort the console thread when heap is low.

Previously, a random running thread was aborted, e.g. the
single-threaded workload.  Recently, just the notification subscribers
were aborted.  But it is common for there to be NO subscribers,
e.g. during a single-threaded workload (our own build!).  Now the
console thread is also aborted (and notifications are punted).

8 years agogtk-screen: Use gtk-style-context to set widget fonts/colors.
Matt Birkholz [Wed, 3 Feb 2016 05:28:55 +0000 (22:28 -0700)]
gtk-screen: Use gtk-style-context to set widget fonts/colors.

8 years agorun-gc-finalizers: Avoid deadlock in this GC daemon.
Matt Birkholz [Tue, 2 Feb 2016 23:53:08 +0000 (16:53 -0700)]
run-gc-finalizers: Avoid deadlock in this GC daemon.

If a GC interrupts a finalizer operation that is holding the
finalizer's lock, it will deadlock in the GC daemon unless it can
punt.

8 years agoGC daemons may run when there is no current thread(!).
Matt Birkholz [Tue, 2 Feb 2016 23:52:05 +0000 (16:52 -0700)]
GC daemons may run when there is no current thread(!).

Thus they cannot use signal-thread-event which, if there is no current
thread, will not return.  (Why DOES signal-thread-event call
run-thread?)

8 years agoFix try-lock-thread-mutex to work when there is no current thread.
Matt Birkholz [Sun, 31 Jan 2016 01:10:37 +0000 (18:10 -0700)]
Fix try-lock-thread-mutex to work when there is no current thread.

GC daemons need to run when there is no current thread.  Try-lock-
thread-mutex was intended for their use.  They do not mind
occasionally skipping an opportunity to clean, including the rare
times when a GC interrupt occurs with no current thread -- in the
thread system of a quiescent world.

Try-lock-thread-mutex was signaling spurious deadlocks when GC daemons
ran with no current thread.  Free locks appeared to be owned by #F --
the current thread.

8 years agoFix directory-read to NOT drop the occasional file.
Matt Birkholz [Sun, 31 Jan 2016 00:34:14 +0000 (17:34 -0700)]
Fix directory-read to NOT drop the occasional file.

char_pointer_to_string was used instead of
char_pointer_to_string_no_gc even though there is no way to retry
the OS_directory_read().

8 years agodebug.c (verify_heap, dump_heap_at): Avoid SIGSEGVing.
Matt Birkholz [Fri, 29 Jan 2016 19:46:44 +0000 (12:46 -0700)]
debug.c (verify_heap, dump_heap_at): Avoid SIGSEGVing.

Check that all pointers and block offsets are valid heap addresses
before following them.  Do not dump words past Free (in bogus objects
at the end of the heap).

8 years agoutils.c (copy_history): Do not update Free unless it all fits.
Matt Birkholz [Fri, 29 Jan 2016 19:29:35 +0000 (12:29 -0700)]
utils.c (copy_history): Do not update Free unless it all fits.

This just keeps bogus pointers out of the heap so that verify_heap
cannot complain about them.

8 years agoworld-monitor: truncate lines
Matt Birkholz [Fri, 29 Jan 2016 19:23:12 +0000 (12:23 -0700)]
world-monitor: truncate lines

8 years agodist/make-src-files: Include tests/ in the source distribution.
Matt Birkholz [Fri, 29 Jan 2016 19:21:54 +0000 (12:21 -0700)]
dist/make-src-files: Include tests/ in the source distribution.

8 years agoEagerly transport list CDRs to linearize lists.
Joe Marshall [Sun, 24 Jan 2016 22:57:50 +0000 (14:57 -0800)]
Eagerly transport list CDRs to linearize lists.

8 years agosrc/microcode/debug.c (verify_heap): Verify pointers.
Matt Birkholz [Sat, 23 Jan 2016 16:21:00 +0000 (09:21 -0700)]
src/microcode/debug.c (verify_heap): Verify pointers.

8 years agosrc/microcode/typename.txt: Rename obsolete types. Re-sort.
Matt Birkholz [Sat, 23 Jan 2016 16:19:28 +0000 (09:19 -0700)]
src/microcode/typename.txt: Rename obsolete types.  Re-sort.

8 years agosrc/microcode/debug.c: Improve verify_heap. Add verify_stack.
Matt Birkholz [Wed, 20 Jan 2016 16:38:03 +0000 (09:38 -0700)]
src/microcode/debug.c: Improve verify_heap.  Add verify_stack.

Scan the stack and note if it is not "sealed" ("closed"?).  It should
have either a return code or a compiled entry at the top.  Also note
any extraordinarily large objects.

8 years agosrc/microcode/stack.h (STACK_LOCATIVE_LESS_P): Rename _ABOVE_P.
Matt Birkholz [Wed, 20 Jan 2016 16:34:23 +0000 (09:34 -0700)]
src/microcode/stack.h (STACK_LOCATIVE_LESS_P): Rename _ABOVE_P.

The stack direction neutral name STACK_LOCATIVE_ABOVE_P(a,b) makes
more sense next to STACK_BOTTOM and STACK_TOP.

8 years agosrc/microcode/gcloop.c (gc_type_map): Undefine obsolete types.
Matt Birkholz [Wed, 20 Jan 2016 16:31:38 +0000 (09:31 -0700)]
src/microcode/gcloop.c (gc_type_map): Undefine obsolete types.

8 years agoruntime/world-report.scm edwin/world-monitor.scm: minor fixes
Matt Birkholz [Wed, 20 Jan 2016 16:27:34 +0000 (09:27 -0700)]
runtime/world-report.scm edwin/world-monitor.scm: minor fixes

Add missing case for thread-execution-state STOPPED.  Add "monitor" flag.

8 years agoRemove REDUCE-LEFT from documentation.
Joe Marshall [Tue, 19 Jan 2016 18:13:06 +0000 (10:13 -0800)]
Remove REDUCE-LEFT from documentation.

8 years agoProper implementation of FOLD-LEFT. Implement FOLD and REDUCE using FOLD-LEFT. ...
Joe Marshall [Tue, 19 Jan 2016 16:52:01 +0000 (08:52 -0800)]
Proper implementation of FOLD-LEFT.  Implement FOLD and REDUCE using FOLD-LEFT.  Remove REDUCE-LEFT.

8 years agoDon't export REDUCE-LEFT from (runtime list).
Joe Marshall [Tue, 19 Jan 2016 16:25:47 +0000 (08:25 -0800)]
Don't export REDUCE-LEFT from (runtime list).

8 years agoUse FOLD-LEFT instead of REDUCE-LEFT.
Joe Marshall [Tue, 19 Jan 2016 16:22:33 +0000 (08:22 -0800)]
Use FOLD-LEFT instead of REDUCE-LEFT.

8 years agoUndo delayed adding of hash-table to population. Instead, skip uniqueness check...
Joe Marshall [Mon, 18 Jan 2016 19:45:37 +0000 (11:45 -0800)]
Undo delayed adding of hash-table to population.  Instead, skip uniqueness check on new hash-tables.

8 years agogtk-screen: Update input operations.
Matt Birkholz [Tue, 15 Dec 2015 08:00:46 +0000 (01:00 -0700)]
gtk-screen: Update input operations.

Edwin no longer uses permanently-register-io-thread-event.

8 years agoMerge branch 'Gtk' into Gtk-Screen.
Matt Birkholz [Sun, 17 Jan 2016 20:41:00 +0000 (13:41 -0700)]
Merge branch 'Gtk' into Gtk-Screen.

8 years agosrc/planetarium/geometry.scm (3d-~=): Misplaced paren.
Matt Birkholz [Sat, 16 Jan 2016 21:13:08 +0000 (14:13 -0700)]
src/planetarium/geometry.scm (3d-~=): Misplaced paren.

8 years agoMerge branch 'master' into Gtk.
Matt Birkholz [Sun, 17 Jan 2016 19:18:05 +0000 (12:18 -0700)]
Merge branch 'master' into Gtk.

8 years agoAdd open-unix-server-socket and unix-server-connection-accept...
Matt Birkholz [Sat, 16 Jan 2016 20:56:18 +0000 (13:56 -0700)]
Add open-unix-server-socket and unix-server-connection-accept...

...and close-unix-server-socket.

8 years agoAdd MONITOR-WORLD Edwin command displaying an animated world-report.
Matt Birkholz [Sun, 17 Jan 2016 00:47:51 +0000 (17:47 -0700)]
Add MONITOR-WORLD Edwin command displaying an animated world-report.

8 years agoAdd a WORLD-REPORT procedure to write a state-of-the-world report...
Matt Birkholz [Sat, 16 Jan 2016 19:45:15 +0000 (12:45 -0700)]
Add a WORLD-REPORT procedure to write a state-of-the-world report...

...showing the current time, heap free, recent GC statistics, and the
known threads.

8 years agoAdd crude thread time accounting.
Matt Birkholz [Sat, 16 Jan 2016 21:56:39 +0000 (14:56 -0700)]
Add crude thread time accounting.

8 years agosrc/runtime/savres.scm (disk-save): Save time world was restored.
Matt Birkholz [Fri, 15 Jan 2016 00:55:40 +0000 (17:55 -0700)]
src/runtime/savres.scm (disk-save): Save time world was restored.

8 years agosrc/runtime/output.scm (write-strings-in-paragraph): Add.
Matt Birkholz [Fri, 15 Jan 2016 00:53:59 +0000 (17:53 -0700)]
src/runtime/output.scm (write-strings-in-paragraph): Add.

8 years agosrc/runtime/gcnote.scm (gc-statistic->string): Abbreviate...
Matt Birkholz [Sun, 17 Jan 2016 18:49:04 +0000 (11:49 -0700)]
src/runtime/gcnote.scm (gc-statistic->string): Abbreviate...

...to keep each line under 80 columns (at least at first).

8 years agoTypos.
Joe Marshall [Sun, 17 Jan 2016 01:20:27 +0000 (17:20 -0800)]
Typos.

8 years agoDon't blow out the stack in STREAM->LIST.
Joe Marshall [Sat, 16 Jan 2016 23:53:58 +0000 (15:53 -0800)]
Don't blow out the stack in STREAM->LIST.

8 years agoDon't add table to rehash population until an entry is created.
Joe Marshall [Sat, 16 Jan 2016 23:51:23 +0000 (15:51 -0800)]
Don't add table to rehash population until an entry is created.

8 years agoAdd STREAM-LAST and STREAM-TRUNCATE. Fixed a typo.
jmarshall [Sat, 16 Jan 2016 04:50:27 +0000 (20:50 -0800)]
Add STREAM-LAST and STREAM-TRUNCATE.  Fixed a typo.

8 years agoterrain: Fix glx-viewport-draw method.
Matt Birkholz [Fri, 8 Jan 2016 19:51:58 +0000 (12:51 -0700)]
terrain: Fix glx-viewport-draw method.

Remove redundant (now incorrect) call to with-glx-widget (i.e.
glXMakeCurrent).  GL no longer allows recursive locking.

Fix %trace to use outf-error instead of generic IO.  The latter may
suspend-current-thread during a callback.

Punt glColorMaterial and much frobbage (e.g. setting params to their
defaults) copied from examples.  Minimize differences between
draw-colored and draw-shaded.

8 years agogl: glx:swap-buffers already does a gl:flush.
Matt Birkholz [Fri, 8 Jan 2016 18:59:31 +0000 (11:59 -0700)]
gl: glx:swap-buffers already does a gl:flush.

8 years agoMerge branch 'master' into Gtk.
Matt Birkholz [Tue, 5 Jan 2016 23:40:12 +0000 (16:40 -0700)]
Merge branch 'master' into Gtk.

8 years agoReturn 0 from OS_test_select_* ONLY if there are no pending...
Matt Birkholz [Tue, 5 Jan 2016 23:15:11 +0000 (16:15 -0700)]
Return 0 from OS_test_select_* ONLY if there are no pending...

...interrupts or subprocess status changes.

8 years agoAdd foreach_async_signal and an ASYNC flag for signal descriptors.
Matt Birkholz [Tue, 5 Jan 2016 23:11:41 +0000 (16:11 -0700)]
Add foreach_async_signal and an ASYNC flag for signal descriptors.

glibio.c uses this to set up its signal forwarder.

8 years agoDo not randomize the FPU control word in x87_read_environment.
Matt Birkholz [Tue, 5 Jan 2016 23:09:04 +0000 (16:09 -0700)]
Do not randomize the FPU control word in x87_read_environment.

Looks like a typo: eax not replaced by rdi.

8 years agoDo not initialize the floating-point environment in x86-64 assembly.
Matt Birkholz [Tue, 5 Jan 2016 23:07:22 +0000 (16:07 -0700)]
Do not initialize the floating-point environment in x86-64 assembly.

The floating-point environment is managed (and needs to be
initialized) by libc.

8 years agoDo not initialize the floating-point environment in i386 assembly.
Matt Birkholz [Tue, 5 Jan 2016 22:55:59 +0000 (15:55 -0700)]
Do not initialize the floating-point environment in i386 assembly.

The floating-point environment is managed (and needs to be
initialized) by libc.

8 years agoAdd interrupts_p and OS_select_registry_entry for glib/glibio.c.
Matt Birkholz [Tue, 5 Jan 2016 22:46:24 +0000 (15:46 -0700)]
Add interrupts_p and OS_select_registry_entry for glib/glibio.c.

8 years agoAdd an ignore_status_change parameter to OS_pause for SMP-IDLE.
Matt Birkholz [Tue, 5 Jan 2016 22:40:55 +0000 (15:40 -0700)]
Add an ignore_status_change parameter to OS_pause for SMP-IDLE.

OS_pause previously returned immediately if there were pending
interrupts OR subprocess status changes, as required by a blocking
test-select-registry primitive.  That made it useless to the SMP-IDLE
primitive, which spins in the idle loop until the io-waiter (or a
timer interrupt handler) gets around to syncing subprocess statuses.
It will spin too after getting a SIGCHLD until statuses are synced.

8 years agoRemove last diff from master in runtime/.
Matt Birkholz [Tue, 5 Jan 2016 22:05:05 +0000 (15:05 -0700)]
Remove last diff from master in runtime/.

The predicate sexpr in master works only because (fix:= 0 #f).
Replace the generic arithmetic (= (or #f 0) 0) only to remove the last
diff with master in runtime/.

8 years agoRemove extra call to maybe-signal-io-thread-events in yield-current-
Matt Birkholz [Tue, 5 Jan 2016 21:59:55 +0000 (14:59 -0700)]
Remove extra call to maybe-signal-io-thread-events in yield-current-

This must have snuck in with a large merge.

8 years agoRemove unused load-option/suppress-loading-message?.
Matt Birkholz [Tue, 5 Jan 2016 21:55:08 +0000 (14:55 -0700)]
Remove unused load-option/suppress-loading-message?.

Reduce runtime/ diffs between this branch and master.

8 years agoRemove obsolete nonblocking/subprocess-wait.
Matt Birkholz [Tue, 5 Jan 2016 21:43:33 +0000 (14:43 -0700)]
Remove obsolete nonblocking/subprocess-wait.

Reduce runtime/ diffs between this branch and master.

8 years agoRemove (stash) debugging %traces in runtime/.
Matt Birkholz [Tue, 5 Jan 2016 21:21:34 +0000 (14:21 -0700)]
Remove (stash) debugging %traces in runtime/.

Reduce runtime/ diffs between this branch and master.

8 years agoPunt without-preemption; use without-interrupts during callouts.
Matt Birkholz [Tue, 5 Jan 2016 18:45:39 +0000 (11:45 -0700)]
Punt without-preemption; use without-interrupts during callouts.

Using without-preemption in (runtime ffi) causes timer interrupts to
be ignored -- COMPLETELY ignored in the glxgears demo's animation
loop.  It is probably no more helpful in with-obarray-lock(?).

8 years agoPunt without-preemption; use without-interrupts during callouts.
Matt Birkholz [Tue, 5 Jan 2016 09:46:36 +0000 (02:46 -0700)]
Punt without-preemption; use without-interrupts during callouts.

Its use in (runtime ffi) causes timer interrupts to be ignored --
completely ignored in the glxgears demo's animation loop.  It is
probably no more helpful in with-obarray-lock(?).

8 years agogtk: Get with Gtk+ v3.16; punt widget colors; use GtkCssProviders.
Matt Birkholz [Mon, 4 Jan 2016 08:40:08 +0000 (01:40 -0700)]
gtk: Get with Gtk+ v3.16; punt widget colors; use GtkCssProviders.

Eliminate or replace calls to deprecated Gtk+ functions.  Punt gtk-
widget-parse-color, gtk-widget-bg-color, etc.  Add gtk-widget-set-
name, gtk-widget-get-style-context, gtk-style-context-add-provider,
<gtk-css-provider>, etc.

8 years agogtk: Port GtkScrolledView and GtkPanedView to Gtk+ 3.10.8.
Matt Birkholz [Tue, 15 Dec 2015 20:12:06 +0000 (13:12 -0700)]
gtk: Port GtkScrolledView and GtkPanedView to Gtk+ 3.10.8.

8 years agogtk: Port GtkScrolledView and GtkPanedView to Gtk+ 3.14.13.
Matt Birkholz [Tue, 15 Dec 2015 19:58:57 +0000 (12:58 -0700)]
gtk: Port GtkScrolledView and GtkPanedView to Gtk+ 3.14.13.

8 years agogtk: No need to frob subprocess-wait anymore.
Matt Birkholz [Fri, 11 Dec 2015 18:49:48 +0000 (11:49 -0700)]
gtk: No need to frob subprocess-wait anymore.

Hook/subprocess-wait is gone.  The default subprocess-wait is now
nonblocking/subprocess-wait.

8 years agoglib: Use g_free to free a *GError allocated with g_try_malloc0.
Matt Birkholz [Mon, 7 Dec 2015 19:31:08 +0000 (12:31 -0700)]
glib: Use g_free to free a *GError allocated with g_try_malloc0.

8 years agogtk: Port GtkScrolledView and GtkPanedView to Gtk+ 3.16.7.
Matt Birkholz [Tue, 15 Dec 2015 01:02:07 +0000 (18:02 -0700)]
gtk: Port GtkScrolledView and GtkPanedView to Gtk+ 3.16.7.

Attempt to pick from multiple implementations per the Gtk+ version.

8 years agogtk: Remove deprecated enums.
Matt Birkholz [Thu, 3 Dec 2015 22:45:28 +0000 (15:45 -0700)]
gtk: Remove deprecated enums.

8 years agoMerge branch 'master' into Gtk.
Matt Birkholz [Mon, 4 Jan 2016 02:21:56 +0000 (19:21 -0700)]
Merge branch 'master' into Gtk.

8 years agoUpdate copyright years.
Matt Birkholz [Sun, 3 Jan 2016 21:41:54 +0000 (14:41 -0700)]
Update copyright years.

8 years agodist/update-copyright.scm: Translate last-copyright-year.
Matt Birkholz [Sun, 3 Jan 2016 21:29:09 +0000 (14:29 -0700)]
dist/update-copyright.scm: Translate last-copyright-year.

8 years agodist/update-copyright.scm: Update files in place.
Matt Birkholz [Sun, 3 Jan 2016 21:27:57 +0000 (14:27 -0700)]
dist/update-copyright.scm: Update files in place.

Start with a clean working tree and you can `git reset --hard HEAD'
when the translation goes badly.

8 years agoNote last-statistic early in signal-gc-events.
Matt Birkholz [Fri, 11 Dec 2015 17:28:50 +0000 (10:28 -0700)]
Note last-statistic early in signal-gc-events.

The signaled thread events may run whenever, perhaps after
last-statistic is changed.  Ensure all the thread events get the same
statistic -- the last-statistic when the events were sent.

8 years agoedwin: Eliminate redundant thread event when setting run-light.
Matt Birkholz [Fri, 11 Dec 2015 17:25:06 +0000 (10:25 -0700)]
edwin: Eliminate redundant thread event when setting run-light.

Using inferior-thread-output! in wait-for-input's thread event signals
another thread event unnecessarily.  The new inferior-thread-run-
light! just sets the flags.

8 years agoEliminate multiple trigger-gc-deamons!.
Matt Birkholz [Fri, 11 Dec 2015 17:16:50 +0000 (10:16 -0700)]
Eliminate multiple trigger-gc-deamons!.

The GC notification in GC events reveals that the after-gc interrupt
handler can run multiple times after one GC.  This seems to happen
when a timer interrupt occurs during trigger-gc-daemons!.  Thread
switching leads to re-signaling.  (Was it assumed interrupt handlers
would not allow thread switching?)

This new interrupt handler is applied with interrupt-mask NOT
/timer-ok and allows timer interrupts only after clearing the after-gc
bit.  A substitute mechanism prevents "us from getting into a loop
just running the daemons."

8 years agoAdd clock time (HH:MM) to GC notifications.
Matt Birkholz [Wed, 9 Dec 2015 22:53:45 +0000 (15:53 -0700)]
Add clock time (HH:MM) to GC notifications.

This makes it easier to see if a long running program is GCing more than
infrequently.

8 years agoedwin: Add a timeout parameter to the peek-no-hang input operations.
Matt Birkholz [Tue, 15 Dec 2015 04:49:47 +0000 (21:49 -0700)]
edwin: Add a timeout parameter to the peek-no-hang input operations.

Factor the busy loop out and name it keyboard-peek-busy-no-hang.  Use
it in the peek-no-hang input operations to implement the timeout.

8 years agoAdd register-gc-event, deregister-gc-event, registered-gc-event.
Matt Birkholz [Tue, 18 Aug 2015 00:19:15 +0000 (17:19 -0700)]
Add register-gc-event, deregister-gc-event, registered-gc-event.

Punt the hook/record-statistic! fluid.  With-gc-notification now uses
dynamic-wind to register and deregister a GC thread event for the
current thread.

Do not use ANY fluid state (e.g. nearest-cmdl/port) during a GC.  Use
the console-i/o-port in hook/gc-start and hook/gc-finish.  GCs can
happen in the thread system when there is no current thread.

The fluid state IS defined during the GC thread events.  At the start
of such events, signal a REPL abort if the heap is low.

8 years agoReplace subprocess status ticks with thread events.
Matt Birkholz [Tue, 21 Jul 2015 01:11:42 +0000 (18:11 -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 replacing without-interrupts with with-thread-
events-blocked suggests a cleaner solution: subprocess thread events.

The new procedures register-subprocess-event and deregister-
subprocess-event are now used by Edwin.  ANY main loop managing
subprocesses AND IO should be using register-subprocess-event along
with with-thread-events-blocked and suspend-current-thread to reliably
block for either in an SMPing world.

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.

8 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.

8 years agoedwin: Fix inferior threads' wait-for-input.
Matt Birkholz [Wed, 9 Dec 2015 21:27:57 +0000 (14:27 -0700)]
edwin: Fix inferior threads' wait-for-input.

Set the run-light BEFORE setting inferior-thread-changes?.  Edwin may
accept-thread-output and clear the flag before it handles the thread
event (which will set the run-light, but not -changes?).

8 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.

8 years agodoc/user-manual: Unix Installation: minor edits.
Matt Birkholz [Thu, 26 Nov 2015 05:38:20 +0000 (22:38 -0700)]
doc/user-manual: Unix Installation: minor edits.

Fix gdbm plugin instructions; there is no configure script in src/gdbm/.

8 years agosvm: finish-cross-compilation of everything using a large heap.
Matt Birkholz [Thu, 26 Nov 2015 05:37:00 +0000 (22:37 -0700)]
svm: finish-cross-compilation of everything using a large heap.

8 years agoUpdate versions to 9.2.1.
Matt Birkholz [Thu, 26 Nov 2015 05:33:35 +0000 (22:33 -0700)]
Update versions to 9.2.1.

9 years agoDon't let mime decoding errors crash imail.
Taylor R Campbell [Sun, 27 Dec 2015 00:01:53 +0000 (00:01 +0000)]
Don't let mime decoding errors crash imail.

9 years agoAutomate the mime codec tests. Still need work.
Taylor R Campbell [Sun, 27 Dec 2015 00:00:29 +0000 (00:00 +0000)]
Automate the mime codec tests.  Still need work.

9 years agoMake all mime decoders signal a common condition type.
Taylor R Campbell [Sat, 26 Dec 2015 23:57:51 +0000 (23:57 +0000)]
Make all mime decoders signal a common condition type.

9 years agoDocument REFERENCE-BARRIER.
Taylor R Campbell [Tue, 27 Oct 2015 13:51:59 +0000 (13:51 +0000)]
Document REFERENCE-BARRIER.

9 years agoffi: Fix callouts that return a struct or union.
Matt Birkholz [Thu, 3 Sep 2015 20:17:46 +0000 (13:17 -0700)]
ffi: Fix callouts that return a struct or union.

I missed a hunk while porting Peter Feigl <craven@gmx.net>'s patch to
commit cf1e855.

9 years agoUse without-interruption and more locking(!) in gcfinal.scm.
Matt Birkholz [Wed, 19 Aug 2015 01:00:50 +0000 (18:00 -0700)]
Use without-interruption and more locking(!) in gcfinal.scm.

Prepare the GC daemon to run concurrently with other threads; lock each
finalizer while it is cleaned in run-gc-finalizers.

Add without-interruption to add-to-, remove-from-, remove-all-from-,
with--lock, and make-gc-finalized-object, NOT to search- or -elements.
Reset-gc-finalizers also lost its without-interrupts, but it is an
after-restore event already executed without-interrupts.

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/os2graph.scm.
Matt Birkholz [Fri, 10 Jul 2015 19:03:02 +0000 (12:03 -0700)]
Remove without-interrupts from runtime/os2graph.scm.

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.