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

How to make method in a class to execute in separate thread but return value to the caller????????

Mat
Callers are anothers methods inside the class
Nov 20 '05 #1
2 3979
"Mat" <re**********@fuckSpam.COM> schrieb
Callers are anothers methods inside the class


Haven't done it by myself, but have a look here:

<F1>
VS.Net
.NET Framework
Programming with .NET Framework
Asyncronous programming

(see hint in signature)
--
Armin

- The tree representing the table of contents has been translated from
localized (German) version. Excuse slight deviations.

Nov 20 '05 #2
On 2003-09-26, Mat <re**********@fuckSpam.COM> wrote:
Callers are anothers methods inside the class


There are a couple of ways to accomplish this... You could use the
ThreadPool.QueueUserWorkItem method - there is an overload that lets you
pass in a state object.

Probably the prefered method would to be to use an asyncronous delegate.
With this method of the delegate to invoke the method. This lets you pass
in a callback function that will be called on the completion of the method.
Using this method, you can retrieve the return value by calling the
delegates EndInvoke method.

Anyway, here is one article that shows async method calls. The code is
in C#, but the principals apply.

http://msdn.microsoft.com/msdnmag/is...c/default.aspx

And here is another one - and this one is in VB.NET :)

http://dotnetjunkies.com/weblog/gran...osts/1206.aspx

HTH,
Tom Shelton
Nov 20 '05 #3

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

Similar topics

8
by: Matthew Bell | last post by:
Hi, I've got a question about whether there are any issues with directly calling attributes and/or methods of a threaded class instance. I wonder if someone could give me some advice on this. ...
3
by: Chris Tanger | last post by:
I am creating a class that has a method "Write" that I wish to make threadsafe. The method must block calling threads until the task performed in write is complete. Only 1 thread at a time can...
11
by: Michael | last post by:
I am new to vb.net and just playing around to get a feel for it. I am coming from a vb6/java background so please excuse me if my idea is plain stupid or contra good programming practice in dot...
3
by: BoloBaby | last post by:
All, I believe I am having a threading problem. Class "BELights" is part of a larger DLL that is used by my main application. A user control (of type BESeat) within the main application raises...
5
by: Doru Roman | last post by:
Hi, Can somebody explain please the meaning and use of a STATIC method? Thanks, Doru
7
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about...
11
by: matsi.inc | last post by:
I am looking to make something like a delegate that i can use in my projects but am having a hard time getting started. The behavior I am most interested in is how a delegate changes it's Invoke...
7
by: Sin Jeong-hun | last post by:
I've using thread a lot in C#, but all of them were just single method with no return value or paramenters. It may sound bizarre but, can't it be a class? I'm writing an Windows application that...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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.