473,804 Members | 3,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asynchronous Programming Model

Hi everyone,
I need to refactor some of our processes using the asynchronous programming
model. I have defined a couple of arrays of delegates to pipline the
asynchronous invocations through different stages of execution.
However I was wondering if there was any information available regarding the
limitations of the asynchronous model, in particular maximum numbers of
asynchronous elements, and limitations of multiple requests potentially
queuing up to call the same callback, and also any information regarding
exception management in the apm. Thanks for any input.
Mar 27 '07 #1
3 2098
I should probably add, the delegates are added to an available pool of
delegates, when they are assigned they are removed from the pool. when work
is complete and the callback is invoked, the delegate is added back to the
pool and may now be reused by other pending items. I am particularly
concerned that exceptions could prevent the callback from taking place and
therefore leak resources, not to mention that the delegate would never return
to the available pool.

"mk" wrote:
Hi everyone,
I need to refactor some of our processes using the asynchronous programming
model. I have defined a couple of arrays of delegates to pipline the
asynchronous invocations through different stages of execution.
However I was wondering if there was any information available regarding the
limitations of the asynchronous model, in particular maximum numbers of
asynchronous elements, and limitations of multiple requests potentially
queuing up to call the same callback, and also any information regarding
exception management in the apm. Thanks for any input.
Mar 28 '07 #2
Hi, mk:

You may see our SocketPro at www.udaparts.com, which is written using
bacthing, asynchrony and parallel computation with online compression.

You may investiage a set of tutorials at
http://www.udaparts.com/document/articles/tutorials.htm.

Wish it is useful to your development.

"mk" <mk@discussions .microsoft.comw rote in message
news:8E******** *************** ***********@mic rosoft.com...
Hi everyone,
I need to refactor some of our processes using the asynchronous
programming
model. I have defined a couple of arrays of delegates to pipline the
asynchronous invocations through different stages of execution.
However I was wondering if there was any information available regarding
the
limitations of the asynchronous model, in particular maximum numbers of
asynchronous elements, and limitations of multiple requests potentially
queuing up to call the same callback, and also any information regarding
exception management in the apm. Thanks for any input.

Mar 28 '07 #3
On Tue, 27 Mar 2007 18:03:32 -0700, mk <mk@discussions .microsoft.com>
wrote:
I should probably add, the delegates are added to an available pool of
delegates, when they are assigned they are removed from the pool. when
work is complete and the callback is invoked, the delegate is added back
to the pool and may now be reused by other pending items. I am
particularly concerned that exceptions could prevent the callback from
taking place and therefore leak resources, not to mention that the
delegate would never return to the available pool.
I'm not sure what you mean there. A delegate isn't a resource that can be
consumed. It's simply a way of describing a method to be called. There
should be no need to manage the allocation of delegates or to maintain any
sort of pool of delegates. You can keep as many references to the same
delegate as you like, and call any of those references any time you like
(within the usual rules of using a delegate, of course).

Since there's no need to manage a pool of delegates, there is also no
concern about whether an exception will result in a delegate not being
returned to the pool.

As for your original question, it's not very clear what it is exactly you
mean to do. However, generally speaking any limitations regarding queuing
of asynchronous methods would be dependent on your own implementation of
that. One common way to process tasks asynchronously is to use the
BackgroundWorke r class, and in that case the only real limitation there is
how many threads can actually be active concurrently. If you reach that
limit, new work items are queued.

Perhaps you should look at the kind of functionality BackgroundWorke r
gives you, try to actually implement your code using that, and then if you
run into problems post new questions in this newsgroup (or even better,
the microsoft.publi c.dotnet.framew ork newsgroup, since it doesn't appear
your question is actually C#-specific), including more details about what
you're actually doing than you've provided so far.

Pete
Mar 28 '07 #4

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

Similar topics

2
3370
by: Graeme Matthew | last post by:
Hi all, I have hit a serious snag ... I am writing an app server. I am happy with pythons threading etc however I am totally confused with handling large request on a socket. For example I can create a threadingTCPServer, the script that calls the app server might send a file or an xml request. Where I am stuck is how do you handle large files ? for example:
6
3486
by: ... | last post by:
Does anyone know a good tutorial on asynchronous programming in .net AsyncCallback And IASyncResult are driving me crazy. And the msdn documentation is not really helpful on this topic I appreciate any recommendation.
5
2094
by: Daniel J Rodriguez | last post by:
Greetings everyone! This is a fairly broard question.. But should be enough to suffice for an answer. Currently we are making an entreprise database server. We will be using C# - my question is this - is Asynchronous Programming in C# sufficient for production grade quality? If so - does anyone know where to find out how many concurrent connections can be reached (although dependant on their data transfered)? Any information in...
9
8678
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am trying to decide if I should use remoting vs. writing a server that uses networkstreams. I have read that networkstreams\tcp programming should be faster than remoting and is a better choice for what I am doing but that it is difficult to code.
15
3274
by: Javier Estrada | last post by:
Can someone explaing the difference between these exception models regarding the structured exception handling? The documentation is not clear. Some code would actually help. Thx
1
1557
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 asynchronous programming and multithreaded programming two different pictures? As I read the help topic above it is not clear to me if the design pattern opens a new thread or not to run the methods asynchronously. 2) One unique thread can run...
0
1760
by: Bishoy George | last post by:
Hi, I have a asp.net 2.0 web application. I want to implement the asynchronous model through http handler in web.config ------------------------------------------------------------------------------------------------------------------------- My web.config file: ---------------------
0
1035
by: Carly | last post by:
Hi, I am not sure I understand what is the meaning of "Execution of asynchronous code is not supported in Windows Forms threading model" - since I am able to create threads and run asynchronous code if I create a Windows form application. Also what would be the diferrence between the threading model of Windows forms and ASP.NET. Please enlighten.
2
2212
by: Morgan Cheng | last post by:
In asynchronous model, BeginXXX method returns a IAsnycResult-derived object. IAsyncResult.AsyncWaitHandle will be signaled when the asynchronous job is complete; and BeginXXX method has a argument as AsyncCallback to be invoked when the job is complete. I am wondering. When the asynchronous is complete, is IAsyncResult.AsyncWaitHandle be signaled first, or AsyncCallback be invoked first?
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10320
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.