[Bordeaux-threads-devel] Basically, I suck (LW patch)

Martin Simmons martin at lispworks.com
Tue Aug 11 13:50:02 UTC 2009


>>>>> On Tue, 11 Aug 2009 00:26:39 +0200, Stelian Ionescu said:
> 
> On Sat, 2009-08-01 at 18:46 -0500, Matt Lamari wrote:
> > I'm still around if anyone needs support on the functions I've added.
> 
> I've cleaned up the code a little(attached as patch against the darcs
> repository), however, before merging I need you to split condition-wait
> in at least 3-4 separate functions because it's way too big(two
> screenfuls here). When you're done, please send a unified diff done
> against the darcs repository.

I have some comments on the patch:

It would be better to implement thread-alive-p by calling mp:process-alive-p.

The relocking of the caller's lock in condition-wait should be inside the
unwind-protect cleanup, otherwise you can throw without the lock held.

Claiming a lock and doing hash table manipulation inside a mp:process-wait
predicate ("Waiting for notification") is not good practice because the
predicate is suppose to be a pure function.  It should be safe to check the
value of wakeup-allowed-to-proceed without the lock and manipulate the hash
table after mp:process-wait has returned.

Is the prog1 in condition-wait redundant?

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/




More information about the bordeaux-threads-devel mailing list