Mailing Lists: Apple Mailing Lists

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

pthreads was: Command timeout, abortPipe causes crash



I think I may have stumbled onto my problem. I am relatively new to pthreads, so it may be a newbie thing.

My code sends data to a USB device using pthreads to do the transfers and poll for status. Each time a data write or a control read/write transaction is executed a new pthread is created which then sends the data with a blocking call, sets some status flags and exits into oblivion.

However it appears that after roughly 4000 or so of these threads are created, execute and die, things start going wacko.

Am I running out of threads?

And If so, do I need to keep the data write thread and control read/write thread alive for the duration of my program, letting them sleep until the next operation is required, waking them to do the work, and sleeping them again until done.

Or I guess I could also do the CFRunLoop thing too.

Paul
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.



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.