Subject: MOO inter-process communication?

From: [email-masked]
Date: Thu, 7 Oct 1993 11:26:58 -0700

Here's a programming feature I'd really like to see.
And here's how I envision it implemented:

A new server command that suspends a task indefinitely if no argument, or
for a maximum of args[1] seconds. Another function which unsuspends the
indefinitely suspended task, also passing it a value. EG:

me:isusp_test this none this
player:tell(task_id());
return_value=isuspend();
return return_value

Well, I forgot a semicolon, but you get the idea... Anyhow, it runs
thusly:

;me:isusp_test()
> 2345678901

;unsuspend(2345678901, "Fred")
> => "Fred"
> => 0

In reality, I don't know which value would be returned first (though I tend
now to think it would be the other way round from what I have here) but
"Fred" is the value passed from the evalled (hypothetical) unsuspend()
function and thus returned by me:isusp_test. Thus, event-sensitive applications could be programmed without frequent polling, and tasks could actually pass
values between them. I think it would be neat and useful, anyway...

====Rob.

---

From: David Van Buren <[email-masked]>
Date: Thu, 7 Oct 1993 13:16:48 -0700

I believe this will be in version 1.8 of the server.  Pavel and I have
also implemented a prototype in moo-code on astrovr as a few verbs and
properties on $command_utils.  I can put a file on parcftp if I get
some messoges of interest via direct email.  Warning - our prototype
is not too smart about processes that crash, so needs an unimplememented
cleanup verb.

						- DVB

---

From: Pavel Curtis <[email-masked]>
Date: Thu, 7 Oct 1993 13:51:59 -0700

> Date:	Thu, 7 Oct 1993 11:26:58 -0700
> From:	[email-masked]
> 

In 1.8.0, these are called `suspend()' (the same old one, but with new behavior
given no arguments) and `resume()' and they work just as you said, except that
the second argument to `resume()' (the one that will be returned by the
corresponding `suspend()' call) is optional.

You're right, by the way: it's quite a handy little primitive.

> now to think it would be the other way round from what I have here)

Quite so, since the resume()ing task gets to stay atomic, of course.

	Pavel

PS- Don't ask when 1.8.0 will be released.  I'm still aiming for sometime this
    calendar year ... or so.