Re: Wise? Stupid? Somewhere in between? Thinkin' out loud...
Re: Wise? Stupid? Somewhere in between? Thinkin' out loud...
- Subject: Re: Wise? Stupid? Somewhere in between? Thinkin' out loud...
- From: Quinn <email@hidden>
- Date: Mon, 12 Jul 2004 15:24:40 +0100
At 23:26 -0700 1/7/04, Dakidd wrote:
Any thoughts from anybody. Sanity checks? Whatever?
It sounds like you're spending a lot of time worrying about
traditional Mac OS, which is a waste of time IMHO. Many of the
concepts you describe won't port nicely to Mac OS X (for example,
Open Transport, polling, cooperative threads), which means that the
code you write today will not be useful in the long term.
Perhaps if you could explain what your application does with network,
I could suggest some alternatives that would integrate well into
traditional Mac OS and Mac OS X.
Anyway, enough preaching, let's answer some questions.
Now, as I understand things, the notifier is (or should I say "the notifier
could be"?) running at interrupt time, which means that I can't really do a
whole lot due to the danger from memory being shifted around, and I want to
do the "exit, stage immediately, even!" thing as quick as possible, right?
Basically true. While it is possible to run your entire networking
engine out of the notifier, it sounds like you want to run mostly
from a thread, in which case it makes for your notifier to do the
minimum amount of work and then split.
What I'm figuring on doing with the read routine is grabbing whatever data
is available (as indicated by the event), cramming it into a buffer
(pointed to by an entry in the ConnectionRef struct - might end up using a
TNetbuf struct for it) and setting a "There's fresh data available" flag in
the ConnectionRef struct for the ReadFrom() function to look at when it
gets called.
Everything sound reasonable so far?
Sure. Except you haven't really told us anything about the behaviour
of ReadFrom if the connection doesn't have sufficient data to satisfy
the request. Do you expect ReadFrom to block, yielding to other
threads? Or does it just return the data that has arrived so far?
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.