[chuck-users] Getting the status of running shreds *into* chuck

Kassen signal.automatique at gmail.com
Sun Jul 8 15:11:59 EDT 2012


> But that won't work when adding a file to the VM, right? I'm doing something
> like

No, it won't. I think the only way to get a (non-degenerate) Shred
object is to link it to a sporked shred. Functionality-wise that's
fine, in practice we'll probably use multiple files.

> That doesn't seem to work. I did a redirect of my main chuck-starter-scripts
> output to a file like this:
> run holde_pkt/ > status.txt 2>&1
> And some info gets into the file, however not the result of chuck ^ or doing
> Machine.status() fro the chuck code :-(

Ah. So my thought experiment sucks. To be honest this was such a
roundabout and impractical way to do it that I didn't even anticipate
anyone would try it (I didn't). I should have realised that such
trivial details don't discourage present company ;-)

Ok, what should proper functionality look like?

How about these;

int[] Machine.runningShreds()
   returns a array of integers, representing all currently running
shreds in ascending order

int  Machine.running(int shred_id)
  returns 1 if shred_id is currently running on the VM, 0 otherwise

Would those leave any usage case uncovered or cause issues otherwise?
I don't think they could be hard to write, we could peek in the status
function to see where the data comes from.


More information about the chuck-users mailing list