slosher2 at home.com
Mon Sep 25 04:42:56 UTC 2000
Bijan Parsia wrote:
> You might try examining the IRCConnection and TelnetMachine classes, in
> particular the #processIO method. They both use stepping to moniter a
> However, I don't think you'd want to use stepping to do low level io, for
> many reasons (including that stepping is tied, afaict, to the current
> project). Perhaps a peek at ConnectionQueue>>listenLoop would be more
> useful. The real key is to establish a Process of the right priority. You
> can use the (Delay forMilliseconds: 500) wait. idiom to get the timing
> right. You want to set the priority to be highIOPriority or lowIOPriority
> (see ProcessorScheduler).
It seems as if the idiom of a repetitive task is used in many different
circumstances, so it seemed a useful abstraction. It would be trivial
to extend this with a getter for priority and then have a creation
method which also sets the priority other than the default.
Initially, I was writing a CronDaemon in Squeak but it really was
overkill, since the interrupt window will schedule the highest priority,
available process - it seems we really don't need a timer Process.
Thoughts on this? Ultimately, a Crond manager would maintain a
collection of registered tasks, so we could manage them, but the details
of rescheduling are contained in the Task instance, instead of a
'crontab'. We can always use a class #startUp method to launch system
tasks (which is what I do).
> Hope this helps.
> Bijan Parsia.
> On Sun, 24 Sep 2000, Kevin Fisher wrote:
> > Hmm, interesting...yes, this might help me. I'm just writing a simple class
> > to poll the serial port every 500ms or so. I've been using the standard
> > SerialPort class, but I'm wondering if the 'flow' classes might be a better
> > solution? I've managed a roundabout way to poll the port using 'steps' right
> > now..quite different from what I've done in pure C in UNIX...
> > >
> > > Does this Task class help? SUnit test requires SUnit 2.6+. It is
> > > tricky to write to the Transcript from background processes, but John
> > > Chludzinski's recent fix will help you.
> > >
> > > Rob
> > [attachment snipped!]
Smalltalking by choice. Isn't it nice to have one!
More information about the Squeak-dev