OT legacy code and printf "magic"
OT legacy code and printf "magic"
- Subject: OT legacy code and printf "magic"
- From: Fabrizio Toso <email@hidden>
- Date: Tue, 08 Jul 2003 09:47:00 +0200
I have a legacy Open Transport server application that has been ported to
Mac OS X 10.2 (Carbon) and is now exhibiting a bug only with "very fast
CPUs" (tipically G4 dual processors).
As usual with real-time systems, the bug only shows up after several
thousands of client requests and is not very easy to replicate...
In this application all the Open Transport APIs are always used in
asynchronous mode and it seems that the problem is that for some reason some
endpoints never receive the "T_UNBINDCOMPLETE" event in the Notifier
function.
While debugging using the old "printf method" I found out (to my dismay)
that if I inserted a "printf" in the T_MEMORYRELEASED case of the Notifier
function, I couldn't replicate the problem anymore.
I thought the reason was in the delay effect of the printf and tried to
substitute the printf function call with a similarly timed delay (50
microsecs), but in this case the bug would eventually show up... I tried
"giving time to the system" while waiting using various methods (usleep,
EventAvail, YieldToAnyThreads and others) but couldn't replicate the "printf
magic" effect...
Any ideas why the printf function call has this effect? Understanding this
could give me a hint about where to look for the real problem... before I
decide to do a complete rewrite of the network layer of the application.
Thanks in advance.
--
Fabrizio Toso
EASYBYTE Software
Converge SpA
_______________________________________________
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.