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.

Thread Data for Thread in pool

Hi,

I'm using thread from a .NET Thread pool. And I assign some data in the
thread during the time of its processing in Thread Local Storage. When the
process gets over and the thread goes back to the pool, what happens to the
data it contained. Is the data invalidated by the time the thread gets
assigned to a different process or does the data continue to persist? How
long the data persists, if at all it does?

Thanks and Regards,
Kishore

Nov 16 '05 #1
5 1978
Hi,
What you mean with "Data" ?

If you mean referenced instances they are collected by the GC in the same
way it does happen when running in the main thread.

Please explain further what you mean. maybe with an example

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Kishore Gopalan" <Ki************@discussions.microsoft.com> wrote in
message news:37**********************************@microsof t.com...
Hi,

I'm using thread from a .NET Thread pool. And I assign some data in the
thread during the time of its processing in Thread Local Storage. When the
process gets over and the thread goes back to the pool, what happens to
the
data it contained. Is the data invalidated by the time the thread gets
assigned to a different process or does the data continue to persist? How
long the data persists, if at all it does?

Thanks and Regards,
Kishore

Nov 16 '05 #2
By "data" I mean any simple data like a string. When the thread is assigned
to another process, will that process be able to see the data stored by the
previous process..??

Thanks and Regards,
Kishore

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,
What you mean with "Data" ?

If you mean referenced instances they are collected by the GC in the same
way it does happen when running in the main thread.

Please explain further what you mean. maybe with an example

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Kishore Gopalan" <Ki************@discussions.microsoft.com> wrote in
message news:37**********************************@microsof t.com...
Hi,

I'm using thread from a .NET Thread pool. And I assign some data in the
thread during the time of its processing in Thread Local Storage. When the
process gets over and the thread goes back to the pool, what happens to
the
data it contained. Is the data invalidated by the time the thread gets
assigned to a different process or does the data continue to persist? How
long the data persists, if at all it does?

Thanks and Regards,
Kishore


Nov 16 '05 #3
Hi,

The memory management does not change depending of the thread, the memory
will be collected when the GC runs and such a memory is not referenced.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Kishore Gopalan" <Ki************@discussions.microsoft.com> wrote in
message news:B2**********************************@microsof t.com...
By "data" I mean any simple data like a string. When the thread is
assigned
to another process, will that process be able to see the data stored by
the
previous process..??

Thanks and Regards,
Kishore

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,
What you mean with "Data" ?

If you mean referenced instances they are collected by the GC in the
same
way it does happen when running in the main thread.

Please explain further what you mean. maybe with an example

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Kishore Gopalan" <Ki************@discussions.microsoft.com> wrote in
message news:37**********************************@microsof t.com...
> Hi,
>
> I'm using thread from a .NET Thread pool. And I assign some data in the
> thread during the time of its processing in Thread Local Storage. When
> the
> process gets over and the thread goes back to the pool, what happens to
> the
> data it contained. Is the data invalidated by the time the thread gets
> assigned to a different process or does the data continue to persist?
> How
> long the data persists, if at all it does?
>
> Thanks and Regards,
> Kishore
>


Nov 16 '05 #4
The thread does not get assigned to a different process, threads are bound to a process and live and die with it. The thread pool is process specific and when you finish with that thread it will go back to the pool. The pool manager may well kill the thread iat some point if there is no work for it to do. The state in the ThreadData will live as long as the thread does.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi,

I'm using thread from a .NET Thread pool. And I assign some data in the
thread during the time of its processing in Thread Local Storage. When the
process gets over and the thread goes back to the pool, what happens to the
data it contained. Is the data invalidated by the time the thread gets
assigned to a different process or does the data continue to persist? How
long the data persists, if at all it does?

Thanks and Regards,
Kishore

Nov 16 '05 #5
Ah - so you're not talking about thread local storage here then, just resrouces allocated during the thread function's execution?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<B2**********************************@microsoft.co m>

By "data" I mean any simple data like a string. When the thread is assigned
to another process, will that process be able to see the data stored by the
previous process..??

Thanks and Regards,
Kishore
Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jesper Matthiesen | last post by:
Hey In the run method of an io-thread I saw this: while(Thread.currentThread() == thread) { ... } Where 'thread' is an instance variable. What is the purpose of this check? Regards Jesper
3
by: David Sworder | last post by:
This message was already cross-posted to C# and ADO.NET, but I forgot to post to this "general" group... sorry about that. It just occured to me after my first post that the "general" group readers...
1
by: hemoji | last post by:
Hi, I'm developing a win32 dll in VC++, I have a thread running continuously in the dll to check for some input on socket, once it finds a input the data is required to be passed to the VB app...
0
by: Laurent Liegeois | last post by:
How to communicate a aspx page with a thread ( one thread per session )? I try to build a thread that be able to communicate with a aspx (C#). Basically, this thread launches a special...
2
by: JPRoot | last post by:
Hi All MSDN documentation explains the thread safety of the Dataset (and the underlying rows and tables) this way "This type is safe for multithreaded read operations. You must synchronize any...
8
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I have an application with several BackgroundWorker threads. I hoped I'd be able to just type backgroundworker1.Name = "bw1"; but I don't see a name property. Any thoughts on how to name a...
2
by: Will McGugan | last post by:
Hi, Is there a canonical way of storing per-thread data in Python? Will McGugan
7
by: Curious | last post by:
On Jun 10, 3:32 am, <s...@dailycoding.comwrote: Thanks! I'll use thread pool.
23
by: =?GB2312?B?0rvK18qr?= | last post by:
Hi all, Recently I had a new coworker. There is some dispute between us. The last company he worked for has a special networking programming model. They split the business logic into...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.