By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,982 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,982 IT Pros & Developers. It's quick & easy.

asynchronous methods or create my own threads?

P: n/a
djc
here is my task:
I am writing a command line utility that I can use to quickly reboot some
wireless access points (why? short answer: budget). That part is already
done. All it does is send the url that is essentially the command to reboot
to one or all of my access points. This works fine. What I want to add to
this is the ability for my program to let me know when the access points
have completed rebooting. In simple terms I just need to repeatedly ping the
access point until it responds which tells me its back up. If I were content
just doing one at a time then no problem. But I'm not.

Rather than send my reboot command to one access point and have to wait for
it to come back up before going on to the next access point I want to send
the command to all the access points (4 in my case) and use 4 new seperate
threads, 1 for each access point, to send the pings. I want my console to
show some indication that its working like printing dots and as each access
point comes back up (responds to the ping) indication should be sent to the
console.

as concisely as possible: command to reboot is sent, starts pinging, pings
first get replies for a few seconds until the access point actually goes
down, then no ping replies indicate its down, then when ping replies come
back again I know the access point is back up again and the reboot was
successfull.

Thats what I'm looking to do. I have done no mutlithreaded programming
before and know only of the general concepts of the asynch pattern and using
the thread classes to manage your own threads.

So what I am hoping to get out of this post is direction on which method
(asynch or threading) is best suited for my task. I will then start reading
up on that method. Any further info or suggestions on my specific task is of
course welcome as well.
Mar 27 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
djc,
If you know you are only going to have 4 access points then most likely just
creating 4 individual threads as background threads each to do the same work
with the same method is the easiest. Asynchronicity won't buy much for you
here since each thread (by your definition) won't be completely done until it
has successfully pinged the access point it rebooted as "back-up".

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"djc" wrote:
here is my task:
I am writing a command line utility that I can use to quickly reboot some
wireless access points (why? short answer: budget). That part is already
done. All it does is send the url that is essentially the command to reboot
to one or all of my access points. This works fine. What I want to add to
this is the ability for my program to let me know when the access points
have completed rebooting. In simple terms I just need to repeatedly ping the
access point until it responds which tells me its back up. If I were content
just doing one at a time then no problem. But I'm not.

Rather than send my reboot command to one access point and have to wait for
it to come back up before going on to the next access point I want to send
the command to all the access points (4 in my case) and use 4 new seperate
threads, 1 for each access point, to send the pings. I want my console to
show some indication that its working like printing dots and as each access
point comes back up (responds to the ping) indication should be sent to the
console.

as concisely as possible: command to reboot is sent, starts pinging, pings
first get replies for a few seconds until the access point actually goes
down, then no ping replies indicate its down, then when ping replies come
back again I know the access point is back up again and the reboot was
successfull.

Thats what I'm looking to do. I have done no mutlithreaded programming
before and know only of the general concepts of the asynch pattern and using
the thread classes to manage your own threads.

So what I am hoping to get out of this post is direction on which method
(asynch or threading) is best suited for my task. I will then start reading
up on that method. Any further info or suggestions on my specific task is of
course welcome as well.

Mar 27 '06 #2

P: n/a
djc
thanks for the input. I'll focus on learning about the system.threading
namespace then.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:71**********************************@microsof t.com...
djc,
If you know you are only going to have 4 access points then most likely just creating 4 individual threads as background threads each to do the same work with the same method is the easiest. Asynchronicity won't buy much for you here since each thread (by your definition) won't be completely done until it has successfully pinged the access point it rebooted as "back-up".

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"djc" wrote:
here is my task:
I am writing a command line utility that I can use to quickly reboot some wireless access points (why? short answer: budget). That part is already
done. All it does is send the url that is essentially the command to reboot to one or all of my access points. This works fine. What I want to add to this is the ability for my program to let me know when the access points
have completed rebooting. In simple terms I just need to repeatedly ping the access point until it responds which tells me its back up. If I were content just doing one at a time then no problem. But I'm not.

Rather than send my reboot command to one access point and have to wait for it to come back up before going on to the next access point I want to send the command to all the access points (4 in my case) and use 4 new seperate threads, 1 for each access point, to send the pings. I want my console to show some indication that its working like printing dots and as each access point comes back up (responds to the ping) indication should be sent to the console.

as concisely as possible: command to reboot is sent, starts pinging, pings first get replies for a few seconds until the access point actually goes
down, then no ping replies indicate its down, then when ping replies come back again I know the access point is back up again and the reboot was
successfull.

Thats what I'm looking to do. I have done no mutlithreaded programming
before and know only of the general concepts of the asynch pattern and using the thread classes to manage your own threads.

So what I am hoping to get out of this post is direction on which method
(asynch or threading) is best suited for my task. I will then start reading up on that method. Any further info or suggestions on my specific task is of course welcome as well.

Mar 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.