11 ms·
I realize the bad example wasn't actually doing anything and the tree example does, but the tree looks like it takes a great deal more effort to actually use.
by loewenskind 16y ago
I realize the bad example wasn't actually doing anything and the tree example does, but the tree looks like it takes a great deal more effort to actually use.
I have a better idea: Erlang already handles green threads extremely well, how about providing a "test mode" switch in the VM. When a branch is encountered in execution the VM spawns new threads as needed and just takes them all. If spawning a new thread would put us over some thread count threshold then just put it on some queue for when there is space for a new thread. Then you can just put pre and post conditions on all your functions and you'll find out if any possible branch traversal causes one of these conditions to fail.