Threading ahh

Yeah, so I finished 312 finally. We implemented threading in ML (and used it to implement speculative memory). It is horrific, but it works.
The last error I had was a stupid one too, and it’s one that I really should have caught.

We have a function scheduler that goes through a list of threads and runs them, one at a time.
Its type should be 'data * 'data state -> 'b since the function never returns, it just calls the next thread when one is done executing.
The type of mine was 'data * 'data state -> 'data * 'data state
This should have been a tipoff for me that something was wrong with the function.
It wasn’t.
I spent like two days trying to figure out why things were encountering empty thread lists and trying to release locks twice.

As Dan said, “You are 8 characters away from being correct.” I had forgotten to do a recursive call to scheduler inside scheduler, which meant I was returning the result of computations instead of running the next computation, as desired.
GAAH.

Oh well, it works now, so I’m happy.

Um, not much else. I really should be studying for 21301 and 18100. Meh. And I have 18100 lab tonight, which sucks. Meh.