Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time stamping tcp packets in OS X



Bill,

I'm also doing quasi real time work with OSX. I've developed a time data server for OS9 that I'm porting to OS X 10.3/Xcode. I've had good success using the POSIX pthreads API combined with termios for real-time handling of a serial port connected GPS time-code generator (Ashtech G12). The time code, output at 20 Hz rate, is acquired from the serial port. triggering the sampling of sensor data. The time stamped data is moved to a UDP packet and transmitted. Each stage is handled by a separate pthread that has priority set depending on timing requirements. I verified the timing using an oscilloscope connected to the serial and ethernet ports while network and gui were very active. The jitter can be reduced considerably by adjusting the real-time parameters. This is all done outside of the kernel! (meaning: easy to code and debug)

The OS X Mach kernel has an good API for setting thread priority from a user program. See:

http://developer.apple.com/documentation/Darwin/Conceptual/ KernelProgramming/scheduler/chapter_8_section_4.html#//apple_ref/doc/ uid/TP30000905-CH211-BABCHEEB

It includes the API to set priorities from a user program.

Good Luck

Michael Goldin
Senior Development Engineer
Scripps Institution of Oceanography
University of California San Diego

phone:  (858) 534-3863
email:  email@hidden
On Apr 9, 2004, at 7:48 AM, W. R. Wing wrote:

Can someone point me in the right direction to look for documentation on near real-time work in OS X? I'd like to be able to apply VERY precise time stamps to tcp packets, and need to minimize jitter associated with other time sharing and interrupt activity. Lots of folks here have experience doing this sort of thing in Linux (with various degrees of success), and in a general way I'd like to know whether or nor OS X lends itself to being able to do this sort of thing better or worse than Linux does. If it just isn't practical, no point in beating some poor post-doc's head against the wall, but if it can do the job much better than Linux, it would be another minor victory.

If there is a better list to post to - I apologize (and would ask for a pointer).

Thanks,
Bill
--
_
/~\ The ASCII | William R. Wing, PhD. email@hidden 865-574-8839
\ / Ribbon Campaign | Network Architect, Oak Ridge National Laboratory
X Against HTML | Network Research Group, Computer Sci & Math Div.
/ \ Email! |_________
_______________________________________________
scitech mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
Do not post admin requests to the list. They will be ignored.
_______________________________________________
scitech mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
Do not post admin requests to the list. They will be ignored.


References: 
 >Time stamping tcp packets in OS X (From: "W. R. Wing" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.