473,405 Members | 2,338 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,405 software developers and data experts.

Delegates, threads and instance methods

Can someone provide me with a simple example as to how to start and stop
a thread that calls an instance method?

All examples on the web seem to call static methods.

Many thanks in advance.


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 1089
christopher green <us************@yahoo.com> wrote:
Can someone provide me with a simple example as to how to start and stop
a thread that calls an instance method?

All examples on the web seem to call static methods.


Instead of new ThreadStart(MethodName) do
new ThreadStart(instance.MethodName)

where instance is a reference to the appropriate instance.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
christopher.

Just quickly go through the article written by John skeet regarding
multithreading. It would clear most of ur ques.

http://www.pobox.com/~skeet/csharp/multithreading.html
Shak.
"christopher green" <us************@yahoo.com> wrote in message
news:OK**************@TK2MSFTNGP11.phx.gbl...
Can someone provide me with a simple example as to how to start and stop
a thread that calls an instance method?

All examples on the web seem to call static methods.

Many thanks in advance.


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #3

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

Similar topics

10
by: Brad | last post by:
Question for all: Would one consider this a loophole in .net with respect to nested (inner) classes? 1) Create outer class Foo and create a nested class Yin (inside Foo's class definition...
2
by: rb531 | last post by:
Guys, I am struck up with a dilemma whether to use threading or delgates for asynchronous processing. Can anyone throw some light on this? Please let me know which one is better. Thanks
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
1
by: Esteban Felipe | last post by:
Hi, thanks for reading. I hope to find some help here before I commit suicide because this is driving me crazy. Please excuse me if this looks like a long post, but I hope that a complete...
3
by: Pavils Jurjans | last post by:
(I am sorry to crosspost both here and in asp.net group. I think, this question quite certainly belongs better to this group, but by error I posted the question to asp.net group) Hello, I am...
13
by: heddy | last post by:
Using Jesse Liberty's excellent book on C#, I am looking at chapter 12 - Delegates. Now, I was under the impression that a delegate is essentially a pointer to a member function. However, when I...
6
by: =?Utf-8?B?Sko=?= | last post by:
I have a logger component that logs to multiple sources, ie textfile, eventlog etc. and I have two methods that depending on where I call up my logger comp. one of them will be called. For ex. if...
0
by: bharathreddy | last post by:
Delegates Here in this article I will explain about delegates in brief. Some important points about delegates. This article is meant to only those who already know delegates, it will be a quick...
4
by: Frankie | last post by:
The following questions are with respect to this delegate declaration: delegate void MyDelegate(string s); Question 1: Why does the following NOT work? Why can't I just create a new instance...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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.