Multi-threading?
[1/6] from: kimm2:mcmaster:ca at: 29-Jun-2002 1:43
Hi, I have a pretty newbie like question.
Is it possible for REBOL to multi-thread? If that's what its called. Is
there an example on the rebol site?
For example:
If a rebol script checked my inbox for messages and replied to those
that were on my "friends" list it would read and reply one at a time.
Is it possible to concurrently check multiple emails?
Thanks!
Matt
[2/6] from: greggirwin:mindspring at: 30-Jun-2002 13:11
Hi Matt,
<< Is it possible for REBOL to multi-thread? If that's what its called. Is
there an example on the rebol site? >>
REBOL scripts can't be multi-threaded, in the sense of pre-emptive
multi-threading like many modern OSs. Maarten Koopmans has written a
lightweight threading engine for use in Rugby, which does cooperative
multithreading, and I have built something similar myself.
Since multi-threading often causes more problems than it solves, the real
question is: Do you *need* it?
<< If a rebol script checked my inbox for messages and replied to those
that were on my "friends" list it would read and reply one at a time.
Is it possible to concurrently check multiple emails? >>
In this example, given that the volume will probably be very low, what does
it gain you? I.e. have you tried a regular version and found it to be
inadequate in some way?
Another approach, of course, is that you might build a larger system out of
multiple scripts, each of which would be handled by the OS but could
communicate with the others via some IPC mechanism.
--Gregg
[3/6] from: kimm2:mcmaster:ca at: 2-Jul-2002 1:32
Hey Greg, thanks for the reply.
<<Maarten Koopmans has written a lightweight threading engine for use in
Rugby, which does cooperative multithreading, and I have built something
similar myself.>>
I'll take a look into Rugby.
<<< If a rebol script checked my inbox for messages and replied to those
that were on my "friends" list it would read and reply one at a time. Is
it possible to concurrently check multiple emails? >>>
<<In this example, given that the volume will probably be very low, what
does it gain you?>>
You're right in that for my personal mail, I shouldn't have an issue.
However, what if such a solution were to be used for corporation or even
as a service to the mass market were potentially hundreds of emails are
being sent per minute?
Matt
[4/6] from: greggirwin:mindspring at: 2-Jul-2002 11:01
Hi Matt,
<<
<<< If a rebol script checked my inbox for messages and replied to those
that were on my "friends" list it would read and reply one at a time. Is
it possible to concurrently check multiple emails? >>>
You're right in that for my personal mail, I shouldn't have an issue.
However, what if such a solution were to be used for corporation or even
as a service to the mass market were potentially hundreds of emails are
being sent per minute?
>>
I'm not a POP/networking kinda' guy, but even in that scenario would you see
a big gain (given that the machine has only a single connection to send
through)? Now, I can see where a system distributed over multiple machines
could work well (maybe have separate servers for small, medium, and large
messages - like with big attachments). Anyway, more than one way to skin a
cat and your goals are the driving force.
Good luck!
--Gregg
[5/6] from: nitsch-lists:netcologne at: 3-Jul-2002 1:29
Am Dienstag, 2. Juli 2002 07:32 schrieb Matthew Kim:
> Hey Greg, thanks for the reply.
> <<Maarten Koopmans has written a lightweight threading engine for use in
<<quoted lines omitted: 10>>
> as a service to the mass market were potentially hundreds of emails are
> being sent per minute?
Thats a problem of asynchronous io, not of multi-threading.
Proof: thready Java now adds asynchronous io for performance.
One thread/connection is heavy overhead.
Rebol can currently do it partly. the basics are there,
but the protocols have to be rewritten to use it.
for selfmade protocols like rugby it works.
AFAIK Holger is working on it.
> Matt
> -----Original Message-----
<<quoted lines omitted: 12>>
> communicate with the others via some IPC mechanism.
> --Gregg
-Volker
[6/6] from: kimm2:mcmaster:ca at: 3-Jul-2002 8:24
<<Thats a problem of asynchronous io, not of multi-threading.
Proof: thready Java now adds asynchronous io for performance. One
thread/connection is heavy overhead. Rebol can currently do it partly.
the basics are there, but the protocols have to be rewritten to use it.
for selfmade protocols like rugby it works. AFAIK Holger is working on
it.>>
Is there a mail protocol that allows for synchronus operation?
One thought I had for an asynchronus approach to my problem would be,
for the REBOL script to first pull 5 emails from the inbox. From there,
concurrently process the 5 emails.
Is there a guide for Rugby, I think it's a little over my head (being a
newbie and all).
And what's thready Java? Is Java better suited for this type or
operation?
Sorry for all the questions guys! But thanks for all your great
responses!
Matt
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted