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

asynchronous methods or create my own threads?

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
2 1585
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hs | last post by:
H I am using the articles by Matt Powell about server side asynchronous web methods (as well as the client side article) However i dont see any improvements to the speed of my application. I'm...
5
by: Marty McDonald | last post by:
I create and start several threads, each thread executes the same method - within the method, a web service is invoked. I find that the more threads I use, the longer it takes for all of the...
6
by: Quiet Man | last post by:
Hi all, I'm designing a fairly simple service that will run on W2K/SP4 and W2K3 servers. It's job is to be a very specialized database server that listens on a given IP address / TCP port and...
1
by: Julian Hershel | last post by:
Reading about asynchronous programming (ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconasynchronousdesignpatterno verview.htm) I could not clarify some doubts. Hope you can help me. 1) Are...
1
by: org | last post by:
Hi, I'm developing a web service with should be used by an .NET CF2 client and an .NET 2.0 Windows client. I've tried to put all the connection logic into one class, which could be used in...
4
by: taskswap | last post by:
I have a legacy application written in C that I'm trying to convert to C#. It processes a very large amount of data from many clients (actually, upstream servers - this is a mux) simultaneously. ...
4
by: Macca | last post by:
I am writing an application that uses asynchronous sockets to get data over ethernet from embedded devices, up to 30 concurrent devices.(These devices are written in C). My application...
0
by: MalamisuraE | last post by:
I need to write a class that will process a qued list of items, each item could take a long or short time based on the items. I want to use Asynchronous Callback Methods to do this instead of...
8
by: Simon Gorski | last post by:
I have a large problem, and I believe there is not yet a way to solve this using IIS and ASP.NET. I hope someone has a solution which we couldn't find. The current situation When a user logs...
5
by: Ryan Liu | last post by:
Hi, I read Microsoft SDK, ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpovrasynchronousprogramming overview.htm there are 4 ways to call EndInvoke: The code in this topic demonstrates...
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
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?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.