By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,991 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,991 IT Pros & Developers. It's quick & easy.

CallContext thread safe

P: n/a
If I call System.Runtime.Remoting.CallContext.SetData() and then I call
System.Runtime.Remoting.CallContext.GetData() from a different thread I get
null, if the thread indeed is the same I get right data.

How to do CallContext.GetData() thread safe?


Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
May 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Tommaso,

The call is thread safe. However, the CallContext in a separate thread
is different than in the thread where you set the data. When you call
SetData, it is like thread local storage, it is only local to that thread of
execution.

You need to store the data some other way.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tommaso Caldarola" <il********@lcimitero.it> wrote in message
news:44**********@x-privat.org...
If I call System.Runtime.Remoting.CallContext.SetData() and then I call
System.Runtime.Remoting.CallContext.GetData() from a different thread I
get null, if the thread indeed is the same I get right data.

How to do CallContext.GetData() thread safe?


Inviato da X-Privat.Org - Registrazione gratuita
http://www.x-privat.org/join.php

May 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.