[BXXPwg] trouble with pending requests

JohnnyXia@acersoftech.com.cn JohnnyXia@acersoftech.com.cn
Fri, 4 Aug 2000 09:50:01 +0800





>  After thinking a bit about the discussion in the WG meeting today and
>speaking with some people, I believe that response frame headers must
>contain the channel number.  This is why:

>1) Current implementations must use the serial number of the pending
>request to pass a response frame to the proper channel.  So in other
>words, a data structure mapping serial numbers of pending requests to
>their proper channels is needed.  This is just a silly thing to do when
>the channel number could simply be passed in the frame header as it is
>with responses, simplifying things a bit and having the added bonus of
>avoiding problem #2.
The ways handling request and response should be different. Generally a
request
is sent in a user thread, and it will wait for the response in this user
thread,
so the response should be notified to this user thread. While a request is
always
handled in a channel thread. In my implementation, if the application does
care
the response, it will pass a Event Handle or a Callback function. and I
will
save it in a struct corresponding to the pending request. When the response
to
this pending request arrives, the Event is signaled or a thread is assigned
and
the Callback function is called. No mapping to the channel is needed.


Johnny Xia.


_______________________________________________
BXXPwg mailing list
BXXPwg@lists.invisible.net
http://lists.invisible.net/mailman/listinfo/bxxpwg