[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NadaNet (was: Re: "Co-Processor" Apple ?)



Robert C. replied:

>"Michael J. Mahon" <mjmahon@aol.com> wrote in message
>20040820033332.26080.00002250@mb-m28.aol.com">news:20040820033332.26080.00002250@mb-m28.aol.com...
>> Robert C. replied:

<snip>

>> > I will be using my 2 Apples as a "Master" / "Slave" setup, so I
>> >was wondering, is there any parts of the code that should be changed? The
>> >Applesoft program you wrote can be easily changed so that it does not use
>> >"machine 2" as a message center, and the Slave polls the Master upon
>> >completion of its job.
>>
>> Yes, it can be changed, but as written it requires at least three
>> machines:  the master, the message server, and at least one
>> "worker" slave.  The master initializes the system and puts
>> "jobs" in a message queue, "workers" receive jobs from the
>> message queue and place results in another message queue,
>> and the master receives the results and prints them.
>>
>> As I note in the documentation, the primary function of the message
>> server is to permit queued asynchronous communication between
>> machines.  If you don't use a message server, then any two
>> communicating machines must "rendezvous", usually by one
>> of them polling in its service loop.

<snip>

>I still do not quite understand the "machine 2 as the message server" part
>of NadaNet: Is it the Applesoft part that dictates that Machine 2 will be
>used as a message server, or is it NadaNet itself that requires this?

The assignment of a machine 2 as the message server is arbitrary,
as long as everyone agrees on which machine will have that role.
In general, having the role of message server requires that a
machine be dedicated, that is, doing little or nothing else,
for reasons described below.

NadaNet does not require anything, but the Applesoft program uses
the message server to hold queues of incoming and finished work.
The "NADANET" binary contains client and server code for the
message server, but the server code is only actually used by the
"designated" message server.

An application could use more than one message server, but it is
not often necessary, and therefore not desirable.  Message classes
are "qualified" by the server, so a message of class $0010 on server
#2 is distinct from a message of class $0010 on server #6, for
example.

If the message server is to do its job, it must be distinct from the
job creating machine(s) and the job processing machine(s).  That
is because it must spend almost all its time polling the network in
its service loop, so that sending and receiving machines will not
have to wait.  This precludes having the message server machine
do much "useful work".

Because the message server provides a "store and forward" function,
all other machines can send and receive messages whenever it is
convenient for them, as opposed to only when their correspondent
is ready to receive/send.

Of course, the downside is that each message must traverse the
network twice, but the benefit of asynchrony is usually well worth it.

-michael

Check out parallel computing for 8-bit Apples on my
Home page:  http://members.aol.com/MJMahon/