Re: [NTLK] newtonscript, NIE and confusion

From: Paul Guyot (pguyot_at_kallisys.net)
Date: Thu Apr 29 2004 - 08:17:38 PDT


Aux environs du 29/04/04 à 10:48 +0200, sous le titre "[NTLK]
newtonscript, NIE and confusion", Adam Short prit sa plus belle plume
pour écrire les mots suivants:
>I write networking code for a living,

Good. So I guess you know the XTI interface.

>I realise I've rambled somewhat, and I apologise for that, but if
>someone could point me in the right direction, I'd appreciate it.

There are three things to know to understand why networking seems so
complex when one comes from a traditional blocking-sockets or
select(3) background:

- NewtonOS is an event-oriented preempted multi-threaded operating
system. Threads are actually called tasks. That's how the processor
succeeds in sleeping most of the time.

- NewtonOS networking is based on endpoints (like XTI) and events.

- NewtonScript is a mono-task cooperative multithreaded environment.
And I wouldn't suggest using threads (actually called forks) because
they are, well, forks, and that's heavy and consumming.

Consequently, while some blocking-like networking facilities exist
(almost always based on forks), a successful networking code must
proceed with events. What the DTS designed with the Thumb sample code
is a Finite State Machine that behaves perfectly to handle all the
events asynchronously (i.e. without an under-the-hood fork).

I suggest reading Newton Programmer's Guide chapter on endpoints.

Paul

-- 
Philosophie de baignoire - consultations sur rendez-vous.
NPDS/NewtonOS: http://newton.kallisys.net:8080/
Apache/FreeBSD: http://www.kallisys.com/
-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
Official Newton FAQ: http://www.chuma.org/newton/faq/
WikiWikiNewt for all kinds of articles: http://tools.unna.org/wikiwikinewt/


This archive was generated by hypermail 2.1.5 : Thu Apr 29 2004 - 08:30:02 PDT