This is a QNX specific implementation for threads. I'm working on developing a wifi driver for the QNX platform.
1 Answers
Answering my own question - text from qnx.com - http://www.qnx.com/developers/docs/660/index.jsp?topic=%2Fcom.qnx.doc.core_networking.user_guide%2Ftopic%2Fnative_drvr_extra.html&resultof=%22nw_pthread_create%22%20
Thread Creation
There are several types of threads that can exist in an instance of io-pkt. The two types of threads created by driver or module developers from above are user-created threads that are either tracked (nw_pthread_create()) or not tracked (pthread_create()) by io-pkt. Regardless of how they're created, all POSIX threads created in io-pkt should be named for easier debugging.
Untracked threads -
The only time you should be dealing with untracked threads is if you're using a library that creates threads for the services it provides. An example of this is the USB stack library (libusbdi), which can create a thread to call user-provided callback functions to handle device insertion and removal. If your code creates a thread directly, you should create a tracked thread as described below. If you're calling library functions that create threads on your behalf, you must manage these threads in your module code, because io-pkt isn't aware of their existence. As stated under the io-pkt Architecture section, threads that aren't tracked can't allocate or free an mbuf or cluster, and can't call functions that perform any manipulation of the stack context pseudo-threading.
Tracked threads -
If you're creating a thread in your io-pkt module, you should always use nw_pthread_create() rather than pthread_create(). The nw_pthread_create() function creates a thread that's tracked by io-pkt. This allows the thread to allocate and free mbuf and cluster memory buffers, and also provides a synchronization mechanism, this being the quiesce functionality, which either blocks all io-pkt-tracked POSIX threads for exclusive operations, or causes these threads to exit on shutdown. All tracked POSIX threads must register a quiesce callback function (defined below). If your thread doesn't register a quiesce callback function, io-pkt can end up in a deadlock situation.

- 124
- 1
- 7