473,322 Members | 1,307 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,322 software developers and data experts.

what does reuse thread meaning -- call thread.Start() again to execute same threadStart again?

How a thread is reused in thread pool?

Change the context and call theThread.Run() again, and it executes same
threadStart?

Thanks!
Ryan
Dec 23 '06 #1
2 2557

Ryan Liu wrote:
How a thread is reused in thread pool?

Change the context and call theThread.Run() again, and it executes same
threadStart?
I'm not sure exactly how the thread pool is implemented, but you use
them via the ThreadPool class. The link below explains everything you
need to know:

http://msdn2.microsoft.com/en-us/lib...hreadpool.aspx

Dec 23 '06 #2
The ThreadPool works with a callback mechanism.
When you call QueueUserWorkItem (For example) you specify a WaitCallback.
When a threadpool thread becomes available, it processes your call, and you
get the result in the callback. At that point the thread is finished with the
workitem and is now available to accept another that's been put in the queue.
Thread.Start has nothing to do with the Threadpool.

Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Ryan Liu" wrote:
How a thread is reused in thread pool?

Change the context and call theThread.Run() again, and it executes same
threadStart?

Thanks!
Ryan
Dec 23 '06 #3

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

Similar topics

0
by: Tum | last post by:
Hi, I've been working on DotGNU trying to implement the correct semantics for monitors, thread.abort (etc) in the runtime. Russell Stuart posted an example a few days ago which we discovered...
3
by: Job Lot | last post by:
I have three data processing routines which I want to run in threads so that they don’t clog up the UI. How can I halt execution of thread until prior thread completes successfully. Private...
9
by: Andy Chang | last post by:
Hi, If I have this function void DoSomething(int& index) { ::Sleep(10000); DoSomethingWith(index); } Is the variable index thread safe? Meaning that if I call this from two
0
by: bob | last post by:
I have a somewhat complex question about how Threading works across the network. Below is the full source code of a program that will list any file modified on myServer. When I run this code from...
5
by: Franco, Gustavo | last post by:
Hi, I have a question, and please I need a answer. How can I finalize a thread running with Application.Run (I need the message loop!!!) without call Thread.Abort?. I want to call...
3
by: kiplring | last post by:
Suppose a function which has Sleep() method in it. And I want to recycle it. I made two buttons which call "Resume()" and "Suspend()". But It doesn't work. The state of thread "t" will be...
6
by: Anders Eriksson | last post by:
Hello! I have a form from which I start an thread running in the background and I want to have an event when the thread is done/ends. I start the thread like this: private Thread prT; // this...
3
by: Bob Day | last post by:
VS 2003, vb.net, sql msde... The help is pretty empatic that you cannot pass parameters to a thread. The sample below is from help, showing you to set up variables in the TasksClass, and assign...
14
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.