Use XSI message queues to implement a request system with two classes of requests: normal priority and high priority.Design the server to handle high-priority requests beforenormal-priority requests.

What will be an ideal response?

One solution is shown in Figure54. The problem is that it doesn’t work on FreeBSD 8.0 and Mac OS X 10.6.8, because these platforms don’t implement msgrcv properly.Byspecifying ?2for the type argument in the msgrcv call, we aresupposed to be returned the ?rst message on the queue with amessage type that is the lowest value less than or equal to ??type??.Looking at the FreeBSD and Mac OS X source code shows us that the kernel implementation of msgrcv simply returns the ?rst message on the queue with a type that is less than or equal to ??type??. Using two separate queues is a possible alternative, but we would need a more complicated design, because if the server wants to block on one queue, the server has no way to be noti?ed when messages areplaced on the other queue. In this case, we could use some other noti?cation mechanism, such as a semaphore or a condition variable and a mutex, and signal the server whenever a message is placed on either of the queues.
image
12548

Computer Science & Information Technology

You might also like to view...

The special memory storage areas built into the CPU are called ________

A) cells B) registers C) accumulators D) buffers

Computer Science & Information Technology

Cloud storage services such as Microsoft SkyDrive offer you remote storage space on an Internet-based server.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology