simonpj [Tue, 23 Nov 1999 11:43:25 +0000 (11:43 +0000)]
[project @ 1999-11-23 11:43:25 by simonpj]
Add test for top-level qualified defns
simonpj [Tue, 23 Nov 1999 11:37:23 +0000 (11:37 +0000)]
[project @ 1999-11-23 11:37:23 by simonpj]
Print module names un-encoded in user style
simonpj [Tue, 23 Nov 1999 11:25:47 +0000 (11:25 +0000)]
[project @ 1999-11-23 11:25:47 by simonpj]
Add documentation about separate compilation
sewardj [Tue, 23 Nov 1999 10:32:37 +0000 (10:32 +0000)]
[project @ 1999-11-23 10:32:37 by sewardj]
Fix typo in exitWith.
sewardj [Tue, 23 Nov 1999 10:03:41 +0000 (10:03 +0000)]
[project @ 1999-11-23 10:03:41 by sewardj]
wibble
sewardj [Tue, 23 Nov 1999 09:59:40 +0000 (09:59 +0000)]
[project @ 1999-11-23 09:59:38 by sewardj]
Update version number.
sewardj [Tue, 23 Nov 1999 09:48:46 +0000 (09:48 +0000)]
[project @ 1999-11-23 09:48:46 by sewardj]
Zap irrelevant ifdefs.
sewardj [Mon, 22 Nov 1999 18:11:00 +0000 (18:11 +0000)]
[project @ 1999-11-22 18:11:00 by sewardj]
cgAlts(): Don't test constructor tag if the scrutinee is known
to come from a product (single-constructor) type.
sewardj [Mon, 22 Nov 1999 17:18:02 +0000 (17:18 +0000)]
[project @ 1999-11-22 17:18:02 by sewardj]
When generating wrapper code for primops/callouts with return type
IO (), don't allocate a unit to return. Instead, return the address
of the unit closure.
sewardj [Mon, 22 Nov 1999 16:44:34 +0000 (16:44 +0000)]
[project @ 1999-11-22 16:44:30 by sewardj]
Nuke DEBUG_EXTRA once and for all, and make Hugs use the same stack
tags as GHC.
sewardj [Mon, 22 Nov 1999 16:16:35 +0000 (16:16 +0000)]
[project @ 1999-11-22 16:16:35 by sewardj]
Convert some DEBUG_EXTRAs into DEBUGs.
sewardj [Mon, 22 Nov 1999 16:02:53 +0000 (16:02 +0000)]
[project @ 1999-11-22 16:02:53 by sewardj]
Include path wibbles.
sewardj [Mon, 22 Nov 1999 16:00:26 +0000 (16:00 +0000)]
[project @ 1999-11-22 16:00:21 by sewardj]
Enforce multiple reader, single writer semantics for Handles.
simonmar [Mon, 22 Nov 1999 15:55:53 +0000 (15:55 +0000)]
[project @ 1999-11-22 15:55:49 by simonmar]
Reduce the number of orphan-instance modules. There are a few left,
but these can't be removed without significant reorganisation due to
recursive dependencies.
sewardj [Mon, 22 Nov 1999 14:39:43 +0000 (14:39 +0000)]
[project @ 1999-11-22 14:39:43 by sewardj]
evalExp(): print a better message if Deadlock is returned
sewardj [Mon, 22 Nov 1999 12:12:09 +0000 (12:12 +0000)]
[project @ 1999-11-22 12:12:09 by sewardj]
Implement Random.setStdGen and Random.getStdGen for Hugs.
simonmar [Mon, 22 Nov 1999 11:54:36 +0000 (11:54 +0000)]
[project @ 1999-11-22 11:54:36 by simonmar]
add libexecdir to SCRIPT_SUBST_VARS.
sewardj [Mon, 22 Nov 1999 11:46:25 +0000 (11:46 +0000)]
[project @ 1999-11-22 11:46:25 by sewardj]
Add comment about Hugs (non-)compliance.
sewardj [Mon, 22 Nov 1999 11:34:11 +0000 (11:34 +0000)]
[project @ 1999-11-22 11:34:09 by sewardj]
Implement CPUTime.getCPUTime, CPUTime.cpuTimePrecision.
sewardj [Mon, 22 Nov 1999 10:56:05 +0000 (10:56 +0000)]
[project @ 1999-11-22 10:56:03 by sewardj]
Implement System.system, System.exitWith for Hugs.
simonmar [Mon, 22 Nov 1999 10:53:51 +0000 (10:53 +0000)]
[project @ 1999-11-22 10:53:51 by simonmar]
eqForeignObj can be an unsafe ccall.
simonmar [Mon, 22 Nov 1999 10:53:11 +0000 (10:53 +0000)]
[project @ 1999-11-22 10:53:11 by simonmar]
remove some irrelevant code
sewardj [Mon, 22 Nov 1999 10:13:00 +0000 (10:13 +0000)]
[project @ 1999-11-22 10:13:00 by sewardj]
Set GHC_INTERPRETER_DIR, and add target rtsclean in interpreter/Makefile.
sewardj [Fri, 19 Nov 1999 16:43:54 +0000 (16:43 +0000)]
[project @ 1999-11-19 16:43:52 by sewardj]
Implement more of IO std library. Buffering settings,
seekery and some error-handling stuff is still missing, but the
rest is done.
sewardj [Fri, 19 Nov 1999 15:42:12 +0000 (15:42 +0000)]
[project @ 1999-11-19 15:42:07 by sewardj]
Duh. Reinstate type variable for state token in Ref type.
Also rename to STRef since that's GHC's name for it.
andy [Fri, 19 Nov 1999 15:36:55 +0000 (15:36 +0000)]
[project @ 1999-11-19 15:36:55 by andy]
General cleanup of Makefile for STG Hugs.
library building has been moved to its own directory.
andy [Fri, 19 Nov 1999 15:33:34 +0000 (15:33 +0000)]
[project @ 1999-11-19 15:33:34 by andy]
Adding Makefile for Hugs lib directory.
sewardj [Fri, 19 Nov 1999 13:54:53 +0000 (13:54 +0000)]
[project @ 1999-11-19 13:54:49 by sewardj]
Make Ref only be parameterised by the type of the mutable value,
rather than by that *and* the type of the state token.
simonmar [Fri, 19 Nov 1999 12:39:49 +0000 (12:39 +0000)]
[project @ 1999-11-19 12:39:49 by simonmar]
Initialize the cost-centre in the header of a new TSO.
kglynn [Fri, 19 Nov 1999 03:44:07 +0000 (03:44 +0000)]
[project @ 1999-11-19 03:44:07 by kglynn]
Removed fix for -ve MUT times, Simon has put fix in rts/Stats.c,
which is where it should be.
sewardj [Thu, 18 Nov 1999 17:32:38 +0000 (17:32 +0000)]
[project @ 1999-11-18 17:32:38 by sewardj]
Export Ref, newRef, readRef, writeRef from the Prelude.
sewardj [Thu, 18 Nov 1999 16:02:21 +0000 (16:02 +0000)]
[project @ 1999-11-18 16:02:17 by sewardj]
Minor bugfixes for concurrency support in Hugs.
Evaluator.c: correctly handle case of entering a black hole.
Prelude.hs: better exception catching in forkIO and primRunIO
GC.c: (revert_dead_CAFs): don't ASSERT(0) on a dead CAF
(I don't know why this assert was there)
sewardj [Thu, 18 Nov 1999 12:10:29 +0000 (12:10 +0000)]
[project @ 1999-11-18 12:10:17 by sewardj]
In hugs, implement ThreadId(..), instance Eq/Ord ThreadId,
and forkIO. Add deleteAllThreads() to scheduler so Hugs can
clean up after evaluation.
andy [Wed, 17 Nov 1999 16:58:43 +0000 (16:58 +0000)]
[project @ 1999-11-17 16:58:43 by andy]
A version of the Prelude with some extra (primitive) functions
exported for use by various system libraries.
andy [Wed, 17 Nov 1999 16:57:51 +0000 (16:57 +0000)]
[project @ 1999-11-17 16:57:38 by andy]
Merging in the various changes between Sep99 Hugs and Nov99 Hugs.
sewardj [Wed, 17 Nov 1999 13:19:36 +0000 (13:19 +0000)]
[project @ 1999-11-17 13:19:36 by sewardj]
cacheprof-related nano-wibble
simonmar [Wed, 17 Nov 1999 11:25:01 +0000 (11:25 +0000)]
[project @ 1999-11-17 11:25:01 by simonmar]
Remove unused FiniteSet stuff.
sewardj [Tue, 16 Nov 1999 17:39:10 +0000 (17:39 +0000)]
[project @ 1999-11-16 17:38:54 by sewardj]
Added basic support for MVars: data MVar, and newMVar, putMVar and
getMVar.
simonmar [Tue, 16 Nov 1999 11:41:39 +0000 (11:41 +0000)]
[project @ 1999-11-16 11:40:32 by simonmar]
sync output
simonmar [Tue, 16 Nov 1999 11:36:15 +0000 (11:36 +0000)]
[project @ 1999-11-16 11:36:15 by simonmar]
sync output
simonmar [Tue, 16 Nov 1999 11:32:09 +0000 (11:32 +0000)]
[project @ 1999-11-16 11:32:09 by simonmar]
Couple of fixes for -accept-output.
simonmar [Tue, 16 Nov 1999 11:11:32 +0000 (11:11 +0000)]
[project @ 1999-11-16 11:11:32 by simonmar]
Pull in _regPrelude if we're profiling.
simonmar [Mon, 15 Nov 1999 14:14:43 +0000 (14:14 +0000)]
[project @ 1999-11-15 14:14:43 by simonmar]
Fix queue corruption bug in unblocking of threads blocked on I/O.
sewardj [Mon, 15 Nov 1999 11:47:02 +0000 (11:47 +0000)]
[project @ 1999-11-15 11:47:02 by sewardj]
Set version to 991115, as this seems a stable point.
sewardj [Fri, 12 Nov 1999 17:50:04 +0000 (17:50 +0000)]
[project @ 1999-11-12 17:50:01 by sewardj]
Wibbles to make get a fully-optimised build to work. (We've been
building debug versions for a v. long time now).
sewardj [Fri, 12 Nov 1999 17:32:48 +0000 (17:32 +0000)]
[project @ 1999-11-12 17:32:36 by sewardj]
Delete optimiser.c (the simplifier) and all supporting bits and
pieces.
sewardj [Fri, 12 Nov 1999 16:38:33 +0000 (16:38 +0000)]
[project @ 1999-11-12 16:38:31 by sewardj]
Decide to use or not use readline depending on the top-level
(fptools) configure machinery.
sewardj [Fri, 12 Nov 1999 16:22:10 +0000 (16:22 +0000)]
[project @ 1999-11-12 16:22:08 by sewardj]
Add checks for readline library (as opposed to headers).
sewardj [Fri, 12 Nov 1999 15:43:14 +0000 (15:43 +0000)]
[project @ 1999-11-12 15:43:12 by sewardj]
Add a test for libreadline.{a|so} (include/readline/readline.h
is already tested for.).
sewardj [Fri, 12 Nov 1999 14:32:44 +0000 (14:32 +0000)]
[project @ 1999-11-12 14:32:44 by sewardj]
Install control-c signal handler in interpreter() after call to
initialize, since that calls startupHaskell, which trashes previous
signal settings.
simonpj [Fri, 12 Nov 1999 14:12:38 +0000 (14:12 +0000)]
[project @ 1999-11-12 14:12:38 by simonpj]
Modify to avoid warning message in test log
simonpj [Fri, 12 Nov 1999 12:51:50 +0000 (12:51 +0000)]
[project @ 1999-11-12 12:51:50 by simonpj]
Document no deriving for existentials
simonpj [Fri, 12 Nov 1999 12:51:20 +0000 (12:51 +0000)]
[project @ 1999-11-12 12:51:20 by simonpj]
Add existential-deriving test
simonmar [Fri, 12 Nov 1999 11:54:17 +0000 (11:54 +0000)]
[project @ 1999-11-12 11:54:09 by simonmar]
Initial revision
simonmar [Fri, 12 Nov 1999 10:18:59 +0000 (10:18 +0000)]
[project @ 1999-11-12 10:18:59 by simonmar]
Fix REG_Su optimised code for update frames (only affects machines
with a REG_Su, such as Sparc).
andy [Thu, 11 Nov 1999 21:13:12 +0000 (21:13 +0000)]
[project @ 1999-11-11 21:13:12 by andy]
This change provided by Alastair Reid is a bunch of wibbles which fix
some severe performance problems in the copy of the Pretty library
distributed with Hugs-Sept99.
The problems show up when making heavy use of hsep (eg printing large
numbers of comma separated lists which tend to run over the end of
line). The problems manifest themselves as the infamous "control
stack overflow" and seem to be due to the generation of large
Int thunks that look something like this:
80 - 4 - 1 - 1 - 3 - 1 - ... -1
(There may be a few +'s in there too but -'s predominate.)
simonpj [Thu, 11 Nov 1999 17:52:59 +0000 (17:52 +0000)]
[project @ 1999-11-11 17:52:58 by simonpj]
Small test fixes
simonpj [Thu, 11 Nov 1999 17:50:49 +0000 (17:50 +0000)]
[project @ 1999-11-11 17:50:47 by simonpj]
Report slow-entry counts in ticky-ticky
sewardj [Thu, 11 Nov 1999 17:42:31 +0000 (17:42 +0000)]
[project @ 1999-11-11 17:42:31 by sewardj]
1. rts_eval_ now returns Killed if evaluator is interrupted,
so act accordingly.
2. RevertCAFs is on by default.
sewardj [Thu, 11 Nov 1999 17:24:49 +0000 (17:24 +0000)]
[project @ 1999-11-11 17:24:49 by sewardj]
Add prototype for interruptStgRts().
simonmar [Thu, 11 Nov 1999 17:19:15 +0000 (17:19 +0000)]
[project @ 1999-11-11 17:19:15 by simonmar]
Re-instate interrupted stuff. If the scheduler finds the interrupted
flag to be set, it calls deleteThread() on all the runnable and
blocked threads, wakes up any main thread clients that were waiting,
and then either
(a) returns, in the UP case
(b) waits for more work, in the SMP case.
sewardj [Thu, 11 Nov 1999 16:27:30 +0000 (16:27 +0000)]
[project @ 1999-11-11 16:27:30 by sewardj]
wibble: Remove irrelevant #ifdef (DOUBLES).
sewardj [Thu, 11 Nov 1999 16:24:12 +0000 (16:24 +0000)]
[project @ 1999-11-11 16:24:12 by sewardj]
Print float/double literals correctly in error messages.
simonmar [Thu, 11 Nov 1999 15:20:29 +0000 (15:20 +0000)]
[project @ 1999-11-11 15:20:28 by simonmar]
grrr, back out changes that snuck in with previous commit.
simonmar [Thu, 11 Nov 1999 15:18:00 +0000 (15:18 +0000)]
[project @ 1999-11-11 15:17:59 by simonmar]
Integer divMod now uses the native GMP method. The PrimOp was already
there, it just wasn't being used.
simonmar [Thu, 11 Nov 1999 15:09:51 +0000 (15:09 +0000)]
[project @ 1999-11-11 15:09:51 by simonmar]
Remove old Spix stuff, replace with shiny new support for Julian's
CacheProf stuff. yay!
simonmar [Thu, 11 Nov 1999 13:17:36 +0000 (13:17 +0000)]
[project @ 1999-11-11 13:17:36 by simonmar]
avoid those annoying -0.00 times.
simonmar [Thu, 11 Nov 1999 11:49:26 +0000 (11:49 +0000)]
[project @ 1999-11-11 11:49:26 by simonmar]
oops, use the correct type
simonmar [Thu, 11 Nov 1999 11:47:22 +0000 (11:47 +0000)]
[project @ 1999-11-11 11:47:22 by simonmar]
forgot type in parameter list
andy [Wed, 10 Nov 1999 23:26:57 +0000 (23:26 +0000)]
[project @ 1999-11-10 23:26:57 by andy]
Adding Int8,16,32,64 into Hugs.
These changes are based on the current (Sep99 Hugs) version of Word.
The GHC parts should be unchanged.
simonmar [Tue, 9 Nov 1999 15:57:42 +0000 (15:57 +0000)]
[project @ 1999-11-09 15:57:39 by simonmar]
Fix up some problems with the IN_STG_CODE macro.
simonmar [Tue, 9 Nov 1999 15:47:09 +0000 (15:47 +0000)]
[project @ 1999-11-09 15:46:49 by simonmar]
A slew of SMP-related changes.
- New locking scheme for thunks: we now check whether the thunk
being entered is in our private allocation area, and if so
we don't lock it. Well, that's the upshot. In practice it's
a lot more fiddly than that.
- I/O blocking is handled a bit more sanely now (but still not
properly, methinks)
- deadlock detection is back
- remove old pre-SMP scheduler code
- revamp the timing code. We actually get reasonable-looking
timing info for SMP programs now.
- fix a bug in the garbage collector to do with IND_OLDGENs appearing
on the mutable list of the old generation.
- move BDescr() function from rts/BlockAlloc.h to includes/Block.h.
- move struct generation and struct step into includes/StgStorage.h (sigh)
- add UPD_IND_NOLOCK for updating with an indirection where locking
the black hole is not required.
simonmar [Tue, 9 Nov 1999 11:38:28 +0000 (11:38 +0000)]
[project @ 1999-11-09 11:38:28 by simonmar]
Test for lit-lits in patterns.
simonmar [Tue, 9 Nov 1999 11:37:40 +0000 (11:37 +0000)]
[project @ 1999-11-09 11:37:38 by simonmar]
Fixes to Simon's lit-lit pattern commit
simonmar [Tue, 9 Nov 1999 10:46:27 +0000 (10:46 +0000)]
[project @ 1999-11-09 10:46:25 by simonmar]
Reset standard file descriptors to blocking mode on exit.
sewardj [Tue, 9 Nov 1999 10:05:07 +0000 (10:05 +0000)]
[project @ 1999-11-09 10:05:07 by sewardj]
mulIntCzh (i386_TARGET_ARCH): xor --> xorl
andy [Tue, 9 Nov 1999 00:41:19 +0000 (00:41 +0000)]
[project @ 1999-11-09 00:41:19 by andy]
Debugging wibble.
andy [Tue, 9 Nov 1999 00:40:12 +0000 (00:40 +0000)]
[project @ 1999-11-09 00:40:11 by andy]
This is to fix the following bugs:
Reported by Description
----------------------------------------------------------------------
Various cutoff value for -c option seems too low.
Andy weirdness with :i C if C is a zero parameter class.
Ross Paterson Problem with rank 2 parameters and "Showable" class.
Jeff Stronger static checking on instances for classes with
functional dependencies.
kglynn [Tue, 9 Nov 1999 00:14:50 +0000 (00:14 +0000)]
[project @ 1999-11-09 00:14:50 by kglynn]
Support for negative timings in the stats file. (I've seen times of -0.00).
If a timing is negative then set it to 0.
simonpj [Mon, 8 Nov 1999 16:38:26 +0000 (16:38 +0000)]
[project @ 1999-11-08 16:38:24 by simonpj]
Deal better with lit-lit pats
simonmar [Mon, 8 Nov 1999 16:24:17 +0000 (16:24 +0000)]
[project @ 1999-11-08 16:24:17 by simonmar]
basck out previous change; Simon is working on a more correct fix
simonmar [Mon, 8 Nov 1999 15:33:20 +0000 (15:33 +0000)]
[project @ 1999-11-08 15:33:20 by simonmar]
Don't allow litlits in patterns.
sewardj [Mon, 8 Nov 1999 15:30:39 +0000 (15:30 +0000)]
[project @ 1999-11-08 15:30:32 by sewardj]
Make Hugs evaluator work with new register table arrangements
arising from Simon's SMP work.
simonmar [Mon, 8 Nov 1999 14:45:52 +0000 (14:45 +0000)]
[project @ 1999-11-08 14:45:52 by simonmar]
Undo previous misguided commit by me
simonmar [Fri, 5 Nov 1999 15:25:49 +0000 (15:25 +0000)]
[project @ 1999-11-05 15:25:49 by simonmar]
Handle potentially blocking writes (yes, I've seen one :) Or rather,
its footprint: unfortunately, the error message didn't appear because
writes to stderr were returning EAGAIN etc. etc., see accompanying
commit to writeError.c.)
simonmar [Fri, 5 Nov 1999 15:22:59 +0000 (15:22 +0000)]
[project @ 1999-11-05 15:22:59 by simonmar]
Clear the non-blocking flag on stderr before trying to print an error
message.
simonmar [Fri, 5 Nov 1999 12:28:06 +0000 (12:28 +0000)]
[project @ 1999-11-05 12:28:05 by simonmar]
_ccall_GC wibbles
simonmar [Fri, 5 Nov 1999 10:09:39 +0000 (10:09 +0000)]
[project @ 1999-11-05 10:09:36 by simonmar]
Allow this syntax on the lhs:
(e1 `op` e2) e3 = ...
(bug reported by Ralf Hinze).
Add a test for it.
sewardj [Thu, 4 Nov 1999 15:09:09 +0000 (15:09 +0000)]
[project @ 1999-11-04 15:09:09 by sewardj]
Fix wibble in setting of HappyCmd.
simonmar [Thu, 4 Nov 1999 10:15:50 +0000 (10:15 +0000)]
[project @ 1999-11-04 10:15:50 by simonmar]
Fix call to StgRun
andy [Thu, 4 Nov 1999 00:32:30 +0000 (00:32 +0000)]
[project @ 1999-11-04 00:32:30 by andy]
Modifing these libs so that they also work with StgHugs.
andy [Wed, 3 Nov 1999 23:54:15 +0000 (23:54 +0000)]
[project @ 1999-11-03 23:54:15 by andy]
Adding Word8,16,32,64 into Hugs.
These changes are based on the current (Sep99 Hugs) version of Word.
The GHC parts should be unchanged.
simonmar [Wed, 3 Nov 1999 15:04:25 +0000 (15:04 +0000)]
[project @ 1999-11-03 15:04:25 by simonmar]
- don't hold the scheduler lock while doing the select, since
we might sit in there for a long time.
- don't need the gettimeofday() hack on Linux, because select
already returns the unslept time.
simonmar [Wed, 3 Nov 1999 15:01:51 +0000 (15:01 +0000)]
[project @ 1999-11-03 15:01:51 by simonmar]
remove bogus #include
simonmar [Wed, 3 Nov 1999 15:00:21 +0000 (15:00 +0000)]
[project @ 1999-11-03 15:00:21 by simonmar]
Add basereg argument to StgRun (not currently handled by anything
except the x86 code, which means SMP only works on x86 at the moment).
simonmar [Tue, 2 Nov 1999 17:19:17 +0000 (17:19 +0000)]
[project @ 1999-11-02 17:19:15 by simonmar]
Time the shutdown code as well as the initialisation code. This
figure is sometimes significant for SMP, because the tasks are all
killed by a signal (at the moment) and it might take a while for the
signal to be delivered.
simonmar [Tue, 2 Nov 1999 17:17:47 +0000 (17:17 +0000)]
[project @ 1999-11-02 17:17:47 by simonmar]
Fix CAF_BLACKHOLE and BLACKHOLE_BQ entry code for SMP case (it was
going into a busy locking state through comparing against the wrong
info pointer)
simonmar [Tue, 2 Nov 1999 17:08:28 +0000 (17:08 +0000)]
[project @ 1999-11-02 17:08:28 by simonmar]
Remove accidental wibble that made it in with the last commit
simonmar [Tue, 2 Nov 1999 17:04:28 +0000 (17:04 +0000)]
[project @ 1999-11-02 17:04:28 by simonmar]
make the prototypes of suspendThread and resumeThread available to the RTS.
simonmar [Tue, 2 Nov 1999 15:06:05 +0000 (15:06 +0000)]
[project @ 1999-11-02 15:05:38 by simonmar]
This commit adds in the current state of our SMP support. Notably,
this allows the new way 's' to be built, providing support for running
multiple Haskell threads simultaneously on top of any pthreads
implementation, the idea being to take advantage of commodity SMP
boxes.
Don't expect to get much of a speedup yet; due to the excessive
locking required to synchronise access to mutable heap objects, you'll
see a slowdown in most cases, even on a UP machine. The best I've
seen is a 1.6-1.7 speedup on an example that did no locking (two
optimised nfibs in parallel).
- new RTS -N flag specifies how many pthreads to start.
- new driver -smp flag, tells the driver to use way 's'.
- new compiler -fsmp option (not for user comsumption)
tells the compiler not to generate direct jumps to
thunk entry code.
- largely rewritten scheduler
- _ccall_GC is now done by handing back a "token" to the
RTS before executing the ccall; it should now be possible
to execute blocking ccalls in the current thread while
allowing the RTS to continue running Haskell threads as
normal.
- you can only call thread-safe C libraries from a way 's'
build, of course.
Pthread support is still incomplete, and weird things (including
deadlocks) are likely to happen.