Re: OpenTransport problem on OS9.2.2
Re: OpenTransport problem on OS9.2.2
- Subject: Re: OpenTransport problem on OS9.2.2
- From: Bob Cook <email@hidden>
- Date: Tue, 15 Apr 2003 18:24:18 -0700
Hi Alice,
On Tuesday, April 15, 2003, at 02:07 PM, Alice Hartley wrote:
So in summary:
InterfaceLib - OS9: OK
CarbonLib - OS9: Bad
OSX: OK.
Is there a difference between InterfaceLib and CarbonLib
handling of OT?
I don't know for sure, but I believe the answer is "yes" because there
were changes to CarbonLib to support something called "asset tracking".
There is a great tech note that describes the gory details.
There is a layer above the OT Support library that is written
in Lisp. Is it likely the problem is in the notifier or might
it be in the higher level layer.
Could be a problem with the Lisp interpreter, but more likely (from
your description) its a notifier issue. Particularly given your next
bit of information...
A user with a T1 line has occasionallu seen a lack of memory - NewPtr
fails
in the Lisp layer. Newptr is used when OTAllocMem fails.
NewPtr cannot be used from a notifier on OS 9. The memory manager is
not safe to call at deferred task time. You will eventually crash. The
generally accepted strategy for out-of-memory conditions is to have
some way to suspend OT operations in your notifier until your main
event loop runs at least once (which will then replenish the memory
pool available to OTAllocMem). My library uses a good size pool of my
own buffers, and when those run out I fall back to using OTAllocMem.
When that fails, I set a flag and wait for code to execute at system
task time that can safely replenish the buffer pool. Then I schedule a
deferred task that will continue reading. This works very well for me,
although I think there are dozens of different ways you might solve the
general problem. I seem to recall reading about this topic a number of
times in the archives.
Good luck,
Bob Cook
_______________________________________________
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.