* Sharing DCE Client Binding Handles?
@ 1993-10-12 21:16 Derk Norton
1993-10-13 12:34 ` Nathaniel Mishkin
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Derk Norton @ 1993-10-12 21:16 UTC (permalink / raw)
Hello,
Can multiple threads within a DCE *client* share a fully bound binding
handle without using a mutex for the handle? If so, are there any
other precautions I should take when doing so?
Thanks in advance,
Derk
**************************************************************************
** Derk Norton Disclaimer: the standard one... **
** U S WEST Advanced Technologies Email: dnorton@advtech.uswest.com **
** 4001 Discovery Drive, Suite 2100 Voice: (303) 541-6393 **
** Boulder, Colorado 80303 USA FAX: (303) 541-6384 **
**************************************************************************
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Sharing DCE Client Binding Handles?
1993-10-12 21:16 Sharing DCE Client Binding Handles? Derk Norton
@ 1993-10-13 12:34 ` Nathaniel Mishkin
1993-10-13 15:33 ` Greg Brail
1993-10-15 23:32 ` David Bell-Lee
2 siblings, 0 replies; 4+ messages in thread
From: Nathaniel Mishkin @ 1993-10-13 12:34 UTC (permalink / raw)
Derk Norton (dnorton@advtech.uswest.com) wrote:
: Can multiple threads within a DCE *client* share a fully bound binding
: handle without using a mutex for the handle? If so, are there any
: other precautions I should take when doing so?
I believe that you can use a single binding handle to concurrently
make calls from multiple threads. However, you _are_ likely to get
into problems concurrently doing other "non-call" operations on the
shared binding handle; e.g., I wouldn't advise doing something like
rpc_binding_reset() from one thread while doing the same (_or_ making
a remote call) on the same binding handle from another thread.
Also, as best I can recall, we did go to some effort to make the
concurrent call case work even when the binding handle isn't "fully
bound" to a server (although one call may stall until the other call
has successfully resolved to a server).
--
-- Nat Mishkin
Atria Software, Inc.
mishkin@atria.com
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Sharing DCE Client Binding Handles?
1993-10-12 21:16 Sharing DCE Client Binding Handles? Derk Norton
1993-10-13 12:34 ` Nathaniel Mishkin
@ 1993-10-13 15:33 ` Greg Brail
1993-10-15 23:32 ` David Bell-Lee
2 siblings, 0 replies; 4+ messages in thread
From: Greg Brail @ 1993-10-13 15:33 UTC (permalink / raw)
In article <dnorton-121093151708@130.13.18.159>,
Derk Norton <dnorton@advtech.uswest.com> wrote:
>Hello,
>Can multiple threads within a DCE *client* share a fully bound binding
>handle without using a mutex for the handle? If so, are there any
>other precautions I should take when doing so?
I've tried it and it works -- however, that's only when using the binding
handle to make RPCs. If you want to rebind or call a function in the
DCE API that takes a binding handle, it'd be best to play it safe and
put a mutex on the handle. If you lock the handle whenever you call a
DCE API function and check if it's locked before every RPC, you should
be fine.
greg
--
Greg Brail ------------------ Citibank -------------------- gjb@fig.citib.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Sharing DCE Client Binding Handles?
1993-10-12 21:16 Sharing DCE Client Binding Handles? Derk Norton
1993-10-13 12:34 ` Nathaniel Mishkin
1993-10-13 15:33 ` Greg Brail
@ 1993-10-15 23:32 ` David Bell-Lee
2 siblings, 0 replies; 4+ messages in thread
From: David Bell-Lee @ 1993-10-15 23:32 UTC (permalink / raw)
Derk,
Regarding your question:
> Can multiple threads within a DCE *client* share a fully bound binding
> handle without using a mutex for the handle? If so, are there any
> other precautions I should take when doing so?
> Thanks in advance,
> Derk
>
Though it is, in general, possible to do, expecially if you follow the
guidelines mentioned in the two previous responses, I would be more
inclined to give each thread its own binding handle. Don't forget that
rpc_binding_copy() will dup a binding handle. You can use thread
specific storage, pthread_cleaup_push(), and pthread_cleaup_pop() to
manage the memory for the per thread binding handles. This would be
useful in case you don't know how many threads (and therefore how many
handles) you'll be using. I started out trying to share binding handles
and quickly realized that I would have many fewer headaches using copies.
*--------------------------------------------------------
* David Bell-Lee
* Senior Technology Consultant
* Hewlett-Packard Educational Services
* Mountain View, CA
*
* Telephone : 415/691-3782
*--------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1993-10-15 23:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-10-12 21:16 Sharing DCE Client Binding Handles? Derk Norton
1993-10-13 12:34 ` Nathaniel Mishkin
1993-10-13 15:33 ` Greg Brail
1993-10-15 23:32 ` David Bell-Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox