From aa779e092c4f4d6a6691f3a4fc4074e6359337f8 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 4 Sep 2013 10:37:10 +0100 Subject: Don't move Capabilities in setNumCapabilities (#8209) We have various problems with reallocating the array of Capabilities, due to threads in waitForReturnCapability that are already holding a pointer to a Capability. Rather than add more locking to make this safer, I decided it would be easier to ensure that we never move the Capabilities at all. The capabilities array is now an array of pointers to Capabaility. There are extra indirections, but it rarely matters - we don't often access Capabilities via the array, normally we already have a pointer to one. I ran the parallel benchmarks and didn't see any difference. --- rts/Task.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'rts/Task.h') diff --git a/rts/Task.h b/rts/Task.h index f18f154117..052647b327 100644 --- a/rts/Task.h +++ b/rts/Task.h @@ -213,11 +213,6 @@ void interruptWorkerTask (Task *task); #endif /* THREADED_RTS */ -// Update any (Capability *) pointers belonging to Tasks after the -// Capability array is moved/resized. -// -void updateCapabilityRefs (void); - // For stats extern nat taskCount; extern nat workerCount; -- cgit v1.2.1