On 27 Mar 2008, at 03:56, Xin LI wrote:
Great work! I have not dig into the code yet but just curious - will it be feasible to have the userland RPC client to share some code to make it MTSAFE?
I took the userland RPC code as a starting point but I have not tried to keep them compatible. The main issue for an MTSAFE RPC client is dealing with replies. The existing locking in the userland RPC code copes with sending the request messages safely but would have problems handling the replies if two threads were trying to read from the socket.
It would be possible to take a similar approach to fixing this in userland. Basically you would build a list of pending requests and arrange for only one thread to read replies at any given time. That thread would examine each reply message and match it to a pending request by examining the XID field. The code is likely to be a bit different from the kernel version but the concept should be similar.