STM: Only wake up once
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 28 Jan 2013 16:15:08 +0000 (11:15 -0500)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 30 Jan 2013 10:50:14 +0000 (10:50 +0000)
commita23661d242e8dd55007c4aee8a053f35de7705bd
treee55bb371b52998e870a252de8768aaf4d1de6849
parent658817bf1b44e9be8a3857c09aae086bef937720
STM: Only wake up once

Previously, threads blocked on an STM retry would be sent a wakeup
message each time an unpark was requested. This could result in the
accumulation of a large number of wake-up messages, which would slow
wake-up once the sleeping thread is finally scheduled.

Here, we introduce a new closure type, STM_AWOKEN, which marks a TSO
which has been sent a wake-up message, allowing us to send only one
wakeup.
includes/Cmm.h
includes/rts/storage/TSO.h
includes/stg/MiscClosures.h
rts/STM.c
rts/StgMiscClosures.cmm