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

Regarding thread

hi,

I have created a thread and called a method from it. Now i want to use the
same thread to execute another method.
This is how i have used.
thread1 = New Thread(AddressOf Method1)
I want to use the same thread "thread1" to execute another method "method2".
How can i do this. Is there any other way to do this?

regards,
Sivaraman.S
Nov 21 '05 #1
2 861
Sivaraman,

I assume that this is what you are looking for

threadpooling
http://msdn.microsoft.com/library/de...eadpooling.asp

I hope this helps?

Cor
Nov 21 '05 #2
On Thu, 7 Oct 2004 01:11:01 -0700, Sivaraman.S wrote:
How can i do this. Is there any other way to do this?


Check out the QueueUserWorkItem in the docs. It lets you use the
threadpool to spin off threads. You don't need to create them yourself
necessarily.

Basically, your sub would have the following signature:

Shared Sub DoWork(stateInfo As Object)
'Code to execute here
End Sub

Then you kick off a thread like this:

ThreadPool.QueueUserWorkItem(AddressOf DoWork)

..Net manages the thread pool.

When you use this method, you don't have control of the threads. Plus, by
default, there is an application wide limit of 25 threads in the thread
pool.

HTH
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #3

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

Similar topics

1
by: sujata | last post by:
Hi, I have a query regarding threads. Is it possible to create thread pools in python.i.e. create threads and then retrieve the memory allocated to it so that the same threads can be used over and...
3
by: Samuel | last post by:
I wrote a very simple httpmodule and tried to compile it with no success. This is my code: ============== Imports System Imports System.Web Imports Microsoft.VisualBasic NameSpace...
6
by: Luca | last post by:
I have a doubt: is it dangerous to create widgets out of the main thread, or it is dangerous to call methods of a widgets out of the thread which created it? or both? TIA Perry
4
by: trialproduct2004 | last post by:
Hi all i am having application in C#. here what i want it to update one datagrid depending on particular value. I want to start minimum of 5 threads at a time and all these threads are updating...
0
by: sonu | last post by:
Hi all, I have a problem regarding use of manualreset events in .net. I have a developed a sample appliation in which entries from the listview which I say is a queue for my processes.I want to...
5
by: archana | last post by:
Hi all, I am using timer to do some functionality on user specified time. I am using system.timers.timer class and its timer to do this functionality. What i am doing is i set autoreset to...
3
by: archana | last post by:
Hi all, I have one confusion regarding threading in windows service which is developed in c#. What i am doing is on 'onstart' event i am starting one thread. In thread procedure i am...
2
by: archana | last post by:
Hi all, I am not clear regarding waitone of manualresetevent. I am invoking webrequest asynchronously with say 5 requests at a time. What i am doing is after invoking request i am calling...
15
by: sat | last post by:
i have seen the check status then it is showing like : Type Of Thread Status HoldL Resting Admin Thread Resting Worker Thread ...
5
by: Abhinay | last post by:
Hi there, I am working on server which used thread pool to process each client request by separate dedicated thread. My intention was each thread ( of thread pool ) have its own logger and hence...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.