When we introduced the server (in The server), we mentioned that the ChannelCreate() function takes a flags parameter and that we'd just leave it as zero.
Now it's time to explain the flags. We'll examine only a few of the possible flags values:
- The receiving thread will not change priority based on the priority of the sender. (We talk more about priority issues in the Priority inheritance section, below). Ordinarily (i.e., if you don't specify this flag), the receiving thread's priority is changed to that of the sender.
- The kernel delivers a pulse whenever a client thread attempts to unblock. The server must reply to the client in order to allow the client to unblock. We'll discuss this one below, because it has some very interesting consequences, for both the client and the server.
- The kernel delivers a pulse whenever a thread blocked on this channel dies. This is useful for servers that want to maintain a fixed pool of threads available to service requests at all times.
- The kernel delivers a pulse whenever all connections from a single client have been disconnected from the server.
- The kernel delivers the client's message size as part of the information given to the server (the srcmsglen member of the struct _msg_info structure).
- The kernel delivers the client's reply message buffer size as part of the information given to the server (the dstmsglen member of the struct _msg_info structure).
- The kernel delivers a pulse whenever any connection owned by this process is terminated due to the channel on the other end going away.