473,394 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

CallContext thread safe

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
1 4500
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: A Rothberg | last post by:
Have some questions about the behavior of CallContext and visibility to the CallContext data. Can someone please confirm (or deny) that the observed behaviors are by design and will not be...
0
by: José Joye | last post by:
I'm playing around with the "CallContext" class to pass around extra information between my client and Server applications (implemented with Remoting). My Server is a SAO-singlecall. If I try...
2
by: José Joye | last post by:
I'm playing around with the "CallContext" class to pass around extra information between my client and Server applications (implemented with Remoting). My Server is a SAO-singlecall. If I try...
5
by: Pham Nguyen | last post by:
Hello, Is it appropriate to use the CallContext class for storing request-specific data? I have a set of business objects that I'm building. Each class contains a hashtable that maps from a key...
3
by: ExclusiveResorts | last post by:
Can the CallContext be used reliably for storing request specific data? We are developing an application library that uses the CallContext to keep an IdentityMap (hashtable of business objects...
1
by: jecheney | last post by:
Hi, Im currently using the following code for reading/writing to a network socket. private StreamReader clientStreamReader; private StreamWriter clientStreamWriter; .... TcpClient tcpClient...
13
by: arun.darra | last post by:
Are the following thread safe: 1. Assuming Object is any simple object Object* fn() { Object *p = new Object(); return p; } 2. is return by value thread safe?
12
by: Peter K | last post by:
Say I have this class public class Simple { private string name; public string Name { get { return name; } set { name = value; }
44
by: climber.cui | last post by:
Hi all, Does anyone have experience on the thread-safty issue with malloc()? Some people said this function provided in stdlib.h is not thread- safe, but someone said it is thread safe. Is it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.