The Racket repository
Go to file
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
.github Create FUNDING.yml 2019-05-24 12:09:34 -04:00
.gitlab Add --disable-generation targets to emulated archs 2019-06-03 22:51:51 +02:00
pkgs cs: change mutable hash tables to be safe only for Racket threads 2019-10-05 16:16:36 -06:00
racket cs: change mutable hash tables to be safe only for Racket threads 2019-10-05 16:16:36 -06:00
.gitattributes Don't include git files in archives. 2010-05-12 01:46:05 -04:00
.gitignore Fix typo. 2019-06-21 12:32:37 -05:00
.gitlab-ci.yml Implement workaround to empty needs keyword 2019-09-30 17:37:40 +02:00
.mailmap Adjust .mailmap. 2019-09-20 12:57:42 -04:00
.travis.yml don't expect Racket CS failures on Travis 2019-07-03 06:24:43 -06:00
appveyor.yml use VS 2013 on AppVeyor 2018-05-15 11:07:06 -06:00
azure-pipelines.yml Add mac tests on Azure. 2018-09-15 12:43:54 -04:00
CONTRIBUTING.md Specify that inbound contributions are licensed under MIT/Apache/LGPL. (#2839) 2019-10-01 10:05:32 -04:00
INSTALL.txt note about installers-from-built makefile target 2019-07-18 08:13:46 -04:00
LICENSE-APACHE.txt Specify that inbound contributions are licensed under MIT/Apache/LGPL. (#2839) 2019-10-01 10:05:32 -04:00
LICENSE-MIT.txt Specify that inbound contributions are licensed under MIT/Apache/LGPL. (#2839) 2019-10-01 10:05:32 -04:00
LICENSE.txt Rename COPYRIGHT.txt to LICENSE.txt 2019-10-01 17:33:06 -04:00
Makefile makefile: avoid git submodule update in cs-as-is 2019-06-22 08:01:12 -06:00
README.md Specify that inbound contributions are licensed under MIT/Apache/LGPL. (#2839) 2019-10-01 10:05:32 -04:00

This is the source code for the core of Racket. See "INSTALL.txt" for full information on building Racket.

To build the full Racket distribution from this repository, run make in the top-level directory. To build minimal Racket, run make base.

The rest of the Racket distribution source code is in other repositories, mostly under the Racket GitHub organization.

Contribute to Racket by submitting a pull request, joining the development mailing list, or visiting the IRC or Slack channels.

Racket is free software; see "COPYRIGHT" and "CONTRIBUTING.md" for more details.