Commit Graph

40607 Commits

Author SHA1 Message Date
Matthew Flatt
2799713ea5 cs & io: fix pipe read/write on concurrent close 2019-10-14 10:53:33 -06:00
Ryan Culpepper
ca2eafbfc4 syntax/parse: fix ~between; closes #2856
Please merge to release branch.
2019-10-14 04:09:22 +02:00
Matthew Flatt
edfcec8211 cs: repair call-with-immediate-continuation-mark
The default-value expression could get lost, replaced with just #f.
2019-10-13 09:38:02 -06:00
Matthew Flatt
edefea7b61 skip some benchmarks as tests
These benchmarks are not interesting as tests, and some don't complete
within the default timeout. Don't bother running them.
2019-10-12 16:28:55 -06:00
Matthew Flatt
cd596e5277 cs: fix error reporting for apply on a non-list 2019-10-12 16:20:16 -06:00
Matthew Flatt
2d3b426d05 cs: rewrite more error messages
Closes #2801
2019-10-12 16:10:42 -06:00
Matthew Flatt
a85a915f88 cs: fix value formatting in car, etc., exceptions 2019-10-12 15:33:55 -06:00
Matthew Flatt
77cdfde679 cs: fix inlining of unsafe vector and box operations
Before this repair, `unsafe-vector-ref` was slower than `vector-ref`.
2019-10-12 13:39:36 -06:00
Matthew Flatt
61e39657fa cs & io: fix caching of locale converters
Fix an interaction with custodians and byte converters that are
used by `string-locale<?`, `string->bytes/locale`, etc.
2019-10-10 17:01:52 -06:00
Matthew Flatt
2338d98761 cs: fix some io demos 2019-10-10 17:01:52 -06:00
Matthew Flatt
9ce8713cdc cs: significantly improve continuation capture and application
Avoid a continuation frame and layer of thunks that was in place for
checking for breaks just after applying a continuation. Instead, we
install just the continuation marks and check for breaks before
actually jumping; the break checker can't tell the difference, since
marks are the only way for it to check the continuation. This
improvement cust about 40% of the time for simple continuation capture
and application.
2019-10-10 17:01:52 -06:00
Matthew Flatt
7f04322531 adjust ctak benchmark
The ctak benchmark had lost a `(lambda (k) ...)`, which made it a
slightly different benchamrk than it was supposed to be. There's not a
good option here; changing it is a break with past Racket
benchmarking, but leaving it broken is misleading. Since the repaired
benchmark runs about the same in traditional Racket, it seems the
lesser evil to repair the benchmark. But also increase the number of
iterations, which makes the benchmark better for Racket CS (which runs
10 titmes as fast) and will help highlight the adjustment if someone
is trying to compare.
2019-10-10 17:01:52 -06:00
Matthew Flatt
67a7a5c869 cs: streamline continuation application slightly
Avoid some allocation and indirect calls, and add a shortcut for the
case where there are no winder changes, no mark changes, etc.
2019-10-10 17:01:52 -06:00
Paulo Matos
d49b182cf4 CI Build RacketCGC and Racket3m with -Werror 2019-10-10 13:18:34 +02:00
Matthew Flatt
067dda578b cs & io: fix log receiver synchronization
A misplaced `wrap-evt` could allow the result from `sync` on
a log receiver to be an opaque event, instead of a vector.

In other cases, a differently misplaced `wrap-evt` could also cause an
internal instance of `control-state-evt` to not be unregistered
correctly.

The solution to both problems is to add a wrapper procedure to
`control-state-evt`.

Closes #2664
2019-10-09 19:46:12 -06:00
Matthew Flatt
2ad4c6f508 cs: unbreak #:in-original-place? for foreign procedures 2019-10-09 19:43:42 -06:00
Matthew Flatt
f3aae7f4fb cs & thread: simplificaton for future "sync" action 2019-10-09 15:52:34 -06:00
Matthew Flatt
7cc3345761 cs & thread: fix place + futures termination
Repair problems with asynchronous callbacks for futures and for
foreign callbacks. Asynchronous callbacks are used for future "sync"
operations, like `hash-set!`, that run must in a place's main thread
(as of commit f574583907).

Separately, synchronization to clean up future threads used a `ping?`
flag in a backwards sense, and it also treated a record as a box.
These problems could cause place termination to hang.

Related to #2725
2019-10-09 13:54:50 -06:00
Matthew Flatt
8ad13a472f cs: implement #:in-original-place? #t for foreign calls
The `math` library relies on this working right, since MPFR is
normally not compiled as thread-safe.

Also, fix some locking/interrupt/atomicity problems with async
callbacks generally.
2019-10-09 13:54:02 -06:00
Matthew Flatt
f812fd9e67 cs: fix misuse of fx>= for _int64, etc. 2019-10-09 13:54:02 -06:00
Matthew Flatt
58e8421618 cs & thread: fix sync on place channel with no writer
When `sync` or `place-channel-get` is used on a place channel whose
other end has been GCed, then the blocking thread should also be
GCable. The `sync` case didn't work because the implementation uses
`replace-evt`. Change `sync` so that it can recognize asynchronous
`replace-evt`s in the same way as semaphores and channels (which is
more than traditional Racket offers).
2019-10-09 13:54:02 -06:00
Paulo Matos
8e6087878d Build racketcs from racketcgc
Like this racketcs pipeline can start sooner since it does not
have to wait for building racket3m
2019-10-09 20:57:34 +02:00
Sam Tobin-Hochstadt
c5affe1e96
Try to fix Slack notifications. 2019-10-09 10:24:20 -04:00
Paulo Matos
b81724c38d Fix use of markdown on Gitlab CI README 2019-10-09 14:52:35 +02:00
Paulo Matos
f6d7e6fa65 Docker image files with pre-installed Racket dependencies
This should speed up building and testing jobs in Gitlab CI for Linux.
2019-10-09 14:49:07 +02:00
Paulo Matos
f160661d45
Enable MZ_ASSERT on Linux (#2852)
Related to #2851
2019-10-09 08:06:48 +02:00
John Clements
877ed67b93 Post-release version for the v7.5 release 2019-10-08 21:16:33 -07:00
Matthew Flatt
1a2c48cbd6 cs & thread: fix place custodian unregister
When a place terminates, it was directly accessing its parent's
custodian. Prior support for cross-place uses of a hash table
probably helped hide this problem previously.
2019-10-08 21:59:15 -06:00
Matthew Flatt
aa4d65f3f2 cs: suppress a "too much serialization" test
At least for now. Chez Scheme can fasl some things that traditional
Racket would refuse. This seems like a problem, but it's not a new
one, and it's not immediately obvious how to fix it. One test started
failing because the representation of scopes changed just enough to
become faslable.
2019-10-08 08:52:27 -06:00
Matthew Flatt
dce39cf24b add note to a broken test
The test doesn't go wrong so often that its crucial to fix now,
but it should be fixd in the near future.
2019-10-08 08:52:26 -06:00
Matthew Flatt
84827d04aa expander: avoid race on multi-scope -> scope table
Although extremely unlikely, it was possible for multiple Racket
threads operating on the same scopes to race on a multi-scope's table
mapping phase levels to scopes.

Also, for some some mutable hash tables that will be shared across
places as read-only in Racket CS, make sure they are definitely set up
for iteration.
2019-10-08 08:52:26 -06:00
Paulo Matos
c996e09e06
Ensure errkind_str is not used uninitialized (#2851)
This removes a compiler warning about `errkind_str` being possibly uninitialized.
2019-10-08 14:11:43 +02:00
Paulo Matos
91e6ab238f Use pmatos/racket-ci:testdeps image for CI
This avoids the download and installation of all the test
dependencies per job, therefore accelerating all test runs.
2019-10-08 13:46:16 +02:00
Matthew Flatt
4ea09bf731 cs & thread: fix shared hash table
An `eq?`-based hash table in the implementation of custodians was
still shared across threads.

Also, taking the global lock at the Rumble level did not disable
interrupts. Since sometimes the lock is taken with interrupts
disabled, threads could potentially deadlock by not having an order.
Fix the problem by disabling interrupts before taking the lock.
2019-10-07 19:05:45 -06:00
Matthew Flatt
5f3ab00351 cify: fix procedure names
Extend the repair in e72f954e85 for cify.
2019-10-07 17:06:30 -06:00
Matthew Flatt
e72f954e85 cs: fix procedure names in startup code
Commit 7d725ab48b interferred with the way that procedure names are
recorded for the code that is built into the Racket executable.
2019-10-07 15:21:14 -06:00
Matthew Flatt
0c4fbda8ba cs: add evt-polling shortcut
For simple cases, avoid `dynamic-wind` and related work when polling
events.
2019-10-07 15:21:14 -06:00
Paulo Matos
ada70bbd68
Fix typo
s/continuaations/continuations/
2019-10-07 21:04:36 +02:00
Matthew Flatt
4c8168cc9d cs: use pseudo-random generator from Chez Scheme
Use the pseudo-random generator API that is now available from Chez
Scheme. While the generator can be written in Scheme, the lack of
unboxed floating-point arithmetic unfortunately makes it about 6 times
as slow as a built-in implementation. That difference is significant
when `sync` uses `random` for fair scheduling.
2019-10-07 11:37:51 -06:00
Paulo Matos
eda5f7a817
Do not run subprocess test unless cc or gcc exist (#2850)
Running this test in a linux docker without cc or gcc installed,
caused a failure.
2019-10-07 14:00:18 +02:00
Matthew Flatt
482fcd6d59 schemify: improve known-value detection
Recognize `(let () <expr>)` and `(begin <expr>)` when inspecting
expressions.
2019-10-06 17:49:32 -06:00
Matthew Flatt
ca285c384d cs: small further improvement to thread swapping
Instead of mutating a record, update virtual registers. Updating a
virtual register doesn't involve a write barrier.
2019-10-06 15:54:49 -06:00
Matthew Flatt
88e7e0a5e4 cs: fix time-apply process timing
The `time-apply` function was measuring thread time instead of proecss
time. While thread time would be more useful in many cases, it's meant
to report process time.
2019-10-06 11:19:27 -06:00
Sam Tobin-Hochstadt
4fb8e4a38d Avoid incorrect use of cadr. (#2848)
Fixes #2847.
2019-10-06 10:02:22 -07:00
Matthew Flatt
9bb5bc9352 expander: re-fix namespace-require/copy
The previous repair shifted by the wrong dimension.
2019-10-05 19:58:54 -06:00
Matthew Flatt
52f6098de8 expander: fix namespace-require/copy at phase > 0 2019-10-05 19:38:21 -06:00
Matthew Flatt
f574583907 cs: change mutable hash tables to be safe only for Racket threads
Mutable `eq?`- and `eqv?`-based hash tables were formerly guarded by a
lock that made them safe for Scheme threads (i.e., OS-level threads).
In particular, that futures could concurrently access hash tables. But
the cost of that lock appears to be too high for such a rarely-used
capability.

Switching `eq?`- and `eqv?`-based hash tables so that they're safe
only for Racket threads means that the lock on a hash table can be
much cheaper. A lock is still needed to because the Rumble layer adds
extra fields for iteration. In the specific case of `hash-ref` on
`eq?`-based tables, however, the lock can be ignored, which makes one
of the most common `hash-ref`s much faster.

Overall, `hash-ref` on a mutable `eq?`-based hash table is now 4-5
times as fast, which makes it about twice as fast as traditional
Racket's `hash-ref`. A `hash-set!` operation is about twice as fast as
before, which puts it on par with traditional Rackets `hash-set!`. The
`hash-ref` improvement makes `send` about twice as fast as before in
Racket CS, making it a little faster than traditional Racket.

Since futures can no longer concurrently access `eq?`- and
`eqv?`-based hash tables, they have to synchronize with the main
thread for access. Racket CS had avoided the "sync" action on futures
that traditional Racket sometimes uses, but this change introduces
sync actions to Racket CS, since it's appropriate for accessing
mutable `eq?`- and `eqv?`-based hash tables.
2019-10-05 16:16:36 -06:00
Matthew Flatt
f8bc4e8fa1 cs: compile FFI stubs in unsafe mode
Unsafe mode saves time compiling the stubs (which happens dynamically
for programs using `ffi/unsafe`) more than running them.
2019-10-05 07:10:23 -06:00
Matthew Flatt
d3d0bffb88 cs: further reduce allocation during thread swapping 2019-10-04 19:39:04 -06:00
Matthew Flatt
f9e12dc9bc fix doc typo 2019-10-04 19:39:04 -06:00