Click here to Skip to main content
15,891,745 members
Everything / Asynchronous

Asynchronous

asynchronous

Great Reads

by Mark Pelf
Tutorial article on Asynchronous Events invocation in C#
by Federico Alterio
Elegant replacement for awaiting a limited set of tasks
by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
by Dev Leader
Problem with async void and a solution for it

Latest Articles

by Federico Alterio
Elegant replacement for awaiting a limited set of tasks
by Dev Leader
In this blog post, we’ll explore the concept of async lazy initialization in C#
by 1f604
Source code and explanation of my io_uring based implementation of b3sum
by Bruno van Dooren
In this article, I will explain Asynchronous Procedure Calls (APCs), their uses and their pitfalls

All Articles

Sort by Title

Asynchronous 

9 Jun 2022 by Pete O'Hanlon
In the previous article, I started describing how I had built a more complex TypeScript web application that retrieves data from a separate API and displays the data in a relatively visually pleasing manner.
19 Jul 2015 by Revanth Ramesh
Futuristic Talking 7-Segment Time Display Widget in WPF
6 Jul 2015 by phillipvoyle
A sample implementation of a minimal http web server using boost::asio in C++
9 Oct 2012 by Paulo Morgado
Sometimes, for demo or testing purposes, I need a synchronization context that behaves like the user interface ones but doesn’t force me to build applications with a user interface and the TPL Dataflow Library seemed like a good option to implement such synchronization context.
15 Jul 2012 by abhinavashubajpai
Hi all,Active Directory provides an enterprise-level tool for organizing, managing, and locating resources in a network.my question is that how can i synchronize an active dirctory with Yammer(an enterprise internal messaging tool).if anyone know about it then please respond me soon...
16 Jul 2012 by Tim Corey
Here is a document that will explain exactly how to synchronize Active Directory with Yammer:https://www.yammer.com/application_support/adsync/YammerADSync.pdf[^]The title of the document is "Active Directory Synchronization Guide"
19 Feb 2021 by honey the codewitch
Use TaskCompletionSource to turn an event or callback based model into a Task based one
10 Apr 2012 by Velkumar Kannan
Hi, I have a panelbar with four panel items. In each panel item click I have to load a usercontrol for that corresponding panelitem. The javascript in usercontrol, which is loaded on PageLoad will work fine. But the javascript in the usercontrol, which is loaded in asyn postback will...
10 Apr 2012 by Pranay Rana
Register you function in EndRequestHandler which as given below may work for you... try { Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler); } catch (ex) { } function...
10 Apr 2012 by Velkumar Kannan
Hi, Whether the function "endRequestHandler" is a javascript function or C# code.
8 Feb 2012 by aka_Rich
Hi Guys, I have some C++ code that is working in Real-Time with a decoder. Its job is to Insert into SQL 2008 R2 and its currently using ADO 2.8 to do it. However i dont want it to block while doing the Insert, because it holds up other packets arriving from the decoder. So i am trying...
8 Feb 2012 by Pablo Aliskevicius
I had something similar a few years ago, my program was reading from a file and inserting into a SQL database. I vaguely emember reading that asynchronous ADO required support from the underlying provider, and MS SQL Server did not provide that support. I used separate threads: one thread...
5 Jan 2014 by Member 10403014
I want to develop a listview in which I can download both text values and images that can be bind together to show the result. Please anyone kindly help me in this. Also I require the data to be downloaded with the AsyncTask. The response from the server is in the string format in which the URL...
5 Jan 2014 by Jayarajantk
Go here [^] for complete tutorial on ListView.WebService and AsyncTask can be found here[^].
21 Oct 2013 by Marla Sukesh
In this article, you should have basic knowledge of web development and some features introduced in prior versions of .NET Framework, especially ASP.NET features.
11 Dec 2013 by Member 10440446
Hi guys, any idea on how am I suppose to create an application on C# 5.0 using async await Telnet client.My scenario is that I have to telnet multiple servers at the same time. Also, i need it to check the servers continuously just like a ping /t function.Thanks much.. :)
12 Dec 2013 by Sergey Alexandrovich Kryukov
Why?! Create a separate thread to work with each separate telnet server and work synchronously. Synchronize those threads using thread synchronization in those rare cases when it is needed.I think asynchronous APIs get popularity when threads were not a commonplace, or just because many...
15 Jul 2014 by Matthew Dennis
// assuming you have created a CancellationToken so you can cancel the Telnet Monitors.List telnetTasks = new List();for (var i = 0; i
14 Aug 2023 by Dev Leader
In this blog post, we’ll explore the concept of async lazy initialization in C#
6 Feb 2023 by Dev Leader
Problem with async void and a solution for it
25 Nov 2015 by Amir Dashti
Simply understand what happens when you use async/await keywords, what are the benefits and how to prevent deadlocks
30 Nov 2015 by Nejimon CR
Implement WCF web service access from WPF with busy indicator and premature cancellation feature without using delegates, background worker, or separate event procedure
12 Sep 2011 by faroukg
Hi there,I have a WCF webservice that executes a function that could take around 10 seconds to complete.The client can call the WCF web service asynchronously by either executing the WCF calls via a thread pool, or using the generated asynchronous methods. However I would like to...
12 Sep 2011 by Sergey Alexandrovich Kryukov
My opinion is: all asynchronous calls dominated well threading was not introduced or well established. I don't see situation when those could beat threads. Threads are easier to implement as in a single thread all logic is sequential, they are well equipped with thread synchronization primitives...
1 Nov 2013 by Gabi Barcan
Call methods of an existing class in MFC asynchronously, while still preserving the thread affinity required by MFC and COM.
21 Jan 2016 by Jagbir Saini
I am working on WEB API having oracle as a back-end. I have one scenario in which I need to call one Store Procedure which is taking some time to execute. I need to to send response or some value to the UI from Service(Web API) without waiting my procedure to execute completely. I have...
31 Jul 2012 by z_azad
Recently I started to evaluation asynchronous communication approaches in CORBA(approaches that there are in CORBA by nature). But I couldn't find any document that illustrates this. Can anyone help me to find and even implementation them? Thanks in advance
11 Sep 2022 by Mark Pelf
Tutorial article on Asynchronous Events invocation in C#
18 Jan 2015 by Member 11092009
How to asynchronous File Upload with blueimp's jQuery file upload pluginhttps://github.com/blueimp/jQuery-File-Upload/wiki/Client-side-Image-Resizing[^]
8 Nov 2012 by silentspeaker
I want to upload larger files on FTP Server. Someone has idea about Asynchronous FTP Uploader using asp.net, need assistance??
30 Jan 2012 by Auric Consulting, LLC
In the code below, there is a BeginRead call which I want to use in an async manner. (warning, code is cobbled together using a variety of code samples found lying around on the internet!) With this sample, I expect the BeginRead to return immediately, and then the callback to be hit later on...
30 Jan 2012 by Herman<T>.Instance
static public void BeginAsyncReadshould bestatic public IAsyncResult BeginAsyncRead
29 Sep 2021 by tugrulGtx
CLOCK caching (LRU approximation) with O(1) cache hit, up to N asynchronous O(1) cache misses
28 Mar 2013 by Florian Rappl
An introduction to async / await, popular mistakes and solutions for asynchronous programming, as well as usages and benefits from using asynchronous programming. We will also discuss interesting patterns based on concurrency.
30 May 2013 by wujapan
Hi alli'm facing a problem with multiple timers where i have two different type of functionalities for timers with the same interval, so in order to achieve asynchronous exection i'm using System.Timers.Timer where these timers will be created on Server(system) thread but not on application...
18 Oct 2013 by ASP.NET Community
Improve the scalability of a website and efficient design for time consuming processes.
7 Aug 2014 by Yannick Brodard
So I have this command :public DelegateCommand GenerateReportForAllClientsCommand { get; set; }public bool CanExecuteGenerateReportForAllClients(){ return true;}public async void GenerateReportForAllClientsExecute(){ if (ClientList.Count
10 Aug 2014 by Yannick Brodard
By searching the web, I found a convenient answer to my problem.I had an other async / await in my GeneratePdfReportAsync method, and I've discovered that a Task or Task object need the UI Thread to be available. But in this case for this method, I didn't need the UI Thread, but it was...
12 Nov 2013 by John Pravin
Asynchronous Programming with Task Parallel Library.
9 May 2018 by wizklaus
it Returns no value Severity Code Description Project File Line Suppression State Warning CS4014 Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. What I have tried: ...
9 May 2018 by User 7429338
The warning means that you declared your method to be asynchronous, while the method is actually synchronous. You could make your method asynchronous like so: public async void ProcessRequests(object sender, ElapsedEventArgs args) { await Task.Run(() => { ...
7 Jul 2014 by Eduardo Antonio Cecilio Fernandes
How to handle asynchronous tasks in Android Activities
20 Jan 2013 by IamBlessed
Hi guysI have a WPF application the uses the MVVM pattern, I also have a button in my WPF client application that is binded to the ICommand implementation, How do I make the UI responsive when the command is still running?Below is my code for my MVVM Implementationprivate void...
20 Jan 2013 by Sergey Alexandrovich Kryukov
You need to execute the command in a separate thread. The only problem is that the intermediate results of the command execution might need to interact with the UI.You cannot call anything related to UI from non-UI thread. Instead, you need to use the method Invoke or BeginInvoke of...
19 Oct 2011 by DANAOS_master
Hi folks,we have a dashboard application that presents data according to dynamically executed SQL read from a database.Up to now application connects to the database, loops against the grids (that present data), reads their SQL source, executes the SQL, presents the results in...
21 Oct 2011 by Ezra Neil
Reading at your question, the first thing that come to my mind is multi-threading. Backgroundworker is threading too but you cannot effectively have more than one threads at a time.Create your own threads and by doing this you can dynamically add more threads as needed. Creating own threads...
7 Feb 2013 by bobb024
Hello,Currently I have an FTP process that grabs as many files that exist on the specific FTP file location and then pulls them down and downloads them. Based on specs changing instead of sending multiple files they are going to send one big file. Is there any suggestions on how to pull...
7 Feb 2013 by Sergey Alexandrovich Kryukov
You cannot really improve throughput by parallel downloading of the files from the same server. (From different servers, yes, a separate thread per service could help, to certain extent. It depends where is the bottleneck. If you have low local bandwidth, even this may not help.)But of...
8 Apr 2012 by PrabhuMuthusamy
Hi friends,I created a Web UserControl.Inside the web userControl i placed a Repeater.Inside the repeater control contains Label, Checkbox and UpdatePanel.Inside the UpdatePanel i placed the Gridview.When i checked the checkbox,i will dispaly a new column.For that when i...
21 Mar 2019 by Amod Kumar Chandra
I am facing following issue NETSDK1064 Package AsyncUsageAnalyzers, version 1.0.0-alpha003 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. Can anyone help...
21 Mar 2019 by Richard Deeming
It's a pre-release package, so you'll need the IncludePreRelease flag to install it: Install-Package AsyncUsageAnalyzers -Version 1.0.0-alpha003 -IncludePrerelease Pre-release versions in NuGet packages | Microsoft Docs[^] NB: That package has not been updated in four years, and the GitHub...
29 Aug 2013 by Keith L Robertson
Write synchronous-looking asynchronous methods without async/await in Visual Studio 2010.
4 Sep 2023 by Federico Alterio
Elegant replacement for awaiting a limited set of tasks
16 Sep 2020 by Jeremy D Richardson
Have a problem that I feel like must have been solved in some elegant ways but wanting some input. I'm using vanilla Javascript to solve this but wondering if perhaps there is a more elegant React solution or some other library. Problem: Have an...
16 Sep 2020 by Chris Copeland
I'm not particularly au fait when it comes to modern JS and the classes available to it, but if you're concerned about asynchronous web requests refreshing the token at the same time, you'd have to look into something like a Mutex. For the flow...
10 Dec 2021 by Stukeley
Hello, I have an issue with my C# code that calls an external procedure written in x64 ASM. [DllImport("...", CallingConvention = CallingConvention.StdCall)] public static extern IntPtr ApplyFilterToImageFragmentAsm(IntPtr bitmapBytes, int...
10 Dec 2021 by Richard Deeming
As I suspected, the problem is that your unmanaged code is running outside of the fixed blocks, so the CLR is free to move the memory around. The pointer you pass in will be pointing to the wrong thing. Since you can't await inside a fixed...
9 Oct 2012 by Paulo Morgado
Sample code I use to demonstrate the use of async/await in C# 5.0
27 Mar 2013 by metastruct
When WebClient, HttpRequest, and all else fail, BITSadmin solves your download woes
25 Mar 2013 by Kapil Waghe
Hello,I'm developing an C# windows application to pull data from main url and then I get the inner url's from main url data and then call the thread to get each inner url data.The same is working but in the process unless and until all inner url data is not fetched the main url data...
1 Feb 2015 by Emiliarge
Comparison of 4 browser engines and controls + some tips for using them (in attached projects and in tip text). Short and clear.
30 Dec 2014 by Babu_Abdulsalam
Various features supporting Concurrency in C++11
3 Jul 2012 by cognismith
I'm writing a server application which uses the .net sockets to communicate using the provided Async functionality, and I have a question regarding the reliability of the method I am using.MSDN - Socket.EndReceive Method (IAsyncResult)[^] Notes that:"All I/O initiated by a given thread is...
3 Jul 2012 by Trak4Net
This is in VB.NET I wrote this several years ago and it has been running successfully without any issues for several years now in a client server application. I am sure it could use a good tune up, but it hasn't ever had any issues and it is heavily used transporting both textual data as well as...
5 Dec 2015 by Krishna P Seetharaman
How to call web service in biztalk asynchronously. Error handling and retrying, sending error email when the web service is down. Resume the orchestration to completion when the service comes back
30 Nov 2011 by kkrakesh
I have one web page MyWebPage.aspx which while loading has to show data from two webservices along with it's own algorithm.1) WebServiceI.SomeMethod() -> Takes 10 seconds aprx. to respond.2) WebServiceII.SomeMethod() -> Takes 10 seconds aprx. to respond.3) My Algorithm -> Takes 5 second...
1 Dec 2011 by kkrakesh
Well,The answer to this problem is "System.Web.UI.PageAsyncTask" class.It allows Asynchronous calls to tasks and waits for completion on the same thread.Also multiple tasks can be created and made to run parallel.Please go through the documentation for further information...Will work in Asp.Net...
18 Sep 2019 by Member 14589606
Only one reading can be taken from a sensor at a time. I used the concept of asynchronous sockets, that is, it is only reading the processor temperature of a single sensor at a time. When you add more, it shows that there is an error. Any ideas would be appreciated. After executing the jobs,...
18 Sep 2019 by OriginalGriff
Quote: The object reference was not set to an object instance This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error means: You have tried to use a variable,...
18 Sep 2019 by Patrice T
Quote: Can only read one temperature reading from the processor of the sensor, for other sensors it does not work The usage of try/catch in your code prevent the program from telling you where the problem arise, and this is an important information. A try/catch is used to hide an error that you...
10 Dec 2021 by Member 13622627
I use openweathermap to get some data (temperature) by letting user enter the Zip Code of his country. I expect to return a response that I can extract the temperature from it. Instead I get the following response Response {type: 'cors', url:...
10 Dec 2021 by Richard Deeming
Mixing async with the older-style .then continuations seems like a waste. You also need to read the content of the response before you can use it. const getWeatherData = async (baseURL, ZIP, KEY) => { const response = await...
25 Mar 2020 by Quí Nguyễn NT
This is a demonstration of a basic example of single page Angular application and micro-service architecture on Azure.
21 Jan 2022 by Bernhard Nebel
How does asynchronous serial communication work, what Arduino libraries are there to support it, and what can go wrong?
15 Jan 2014 by Peter Butzhammer
This article shows how to use C# 5 async functions to create a continuous asynchronous ping and report progress to the UI.
15 Apr 2014 by stixoffire
I am writing an application - I want to pass a set of parameters to a method and run that method Asynchronously and Continually after calling it, While it is running I want the values it sees to be returned to the calling routine and I want to be able to do that continuously [via an event is...
15 Apr 2014 by Sergey Alexandrovich Kryukov
There is nothing absolutely continuous and asynchronous at the same time. When you want to monitor a thread, you should synchronize your calling thread and another thread. The minimal synchronization facility can be a lock: http://msdn.microsoft.com/en-us/library/c5kehkcz.aspx[^]. It would...
15 Apr 2014 by Bernhard Hiller
Encapsulate the parameters, the routine, and the event in a class.Your main application creates an instance of it, subscribes the event, then starts the routine Thread thread = new Thread(() => myObject.StartRoutine()); thread.Start();Note that the event is fired in a different thread than...
16 Apr 2014 by stixoffire
Hi All - after seeing Sergey and Bernhards answers - I decided to do a bit more searching using the guidance provided; Thank you Bernhard for stating simply , Thank you Sergey for your list of gotchas and things to remember. The article which I found and is most excellent for me I found here:...
28 Nov 2016 by Neal Pandey
This article is a tutorial on creating a basic OData (Open Data Protocol) endpoint for a MongoDB database using MEAN stack.
17 Dec 2018 by Benktesh Sharma
Tips for tracking progress on multiple async tasks in Android
8 Dec 2019 by Abdulrahman Emad
This article proposes a solution for plugging "Rg.Plugins.Popup" asynchronous into your code.
15 Feb 2014 by x0rn
Dear .Net Developers, I need some help. I am developing network client-server applications using TCP/IP socket technique and C#. I need to distribute the data located in XML file from server application to several subscribers apps: console windows apps and web apps. I wrote server applications...
15 Feb 2014 by Paulo Zemek
Lately I always use streams, but I see that you are using the socket.BeginSend.If I am not wrong, the Send (and consequently the BeginSend) can send less bytes than requested. So, you ask it to send 100 bytes and, for "splitting" reasons, it only sends 50. It actually returns that it sent 50...
20 Oct 2013 by Member 8392278
Does anyone have a simple way of making this TreeView WinForm app multithreaded – the UI locks up. I have experimented with the backgroundworker , treeview.invoke and delegates but need help in these areas. Thank you in advance for any assistance.
18 Oct 2013 by OriginalGriff
Doing the Threading stuff is pretty easy - a Background worker will handle that: BackgroundWorker work = new BackgroundWorker(); work.DoWork += new DoWorkEventHandler(work_DoWork); work.ProgressChanged += new...
27 Jun 2013 by Jeneesh K. Velayudhan
I have one Initialize() in my class and I am calling a delegate wrapper method from this function as follows (the call back method will call around 20 times in a sec),public Initialize(){ CX_OUTPUT_CALLBACK cb = new CX_OUTPUT_CALLBACK(OutDelegateCb); ...
27 Jun 2013 by Ron Beyer
public Initialize(){ CX_OUTPUT_CALLBACK cb = new CX_OUTPUT_CALLBACK(OutDelegateCb); AureusSDK_Wrapper_VideoCallbackFunSetup.CX_SetOuputCallBack(cb, cnt); GC.KeepAlive(cb);} public static void OutDelegateCb(IntPtr p_aureus_video_output,...
28 Jun 2013 by Jeneesh K. Velayudhan
24 Aug 2020 by cupidanish
what is the difference between example 1 and example 2: Example 1: function a () { console.log("A is running"); b(); } function b () { console.log("B is running") } a(); Example 2: const fun1 = function a (callback) { ...
24 Aug 2020 by F-ES Sitecore
The difference is that in the first example "a" can only then go on to call "b" as the call to "b" is hard-coded in "a". In the second example the calling code decides what function "a" calls, so it could be "b", it could be "c", it could even...
24 Aug 2020 by Gomehere Blogger
The callback function is important to us, Its works as an argument passing in the function. Its something required asynchronous function called and think, you need to wait for that response and want to process that response ahead that could be...
8 Oct 2012 by Erick Dee
Hello all,I'm having this problem with an app I tried to deploy to IIS version 6.1. My code makes an asynchronous call (via a WebClient and delegate code) to retrieve XML data from a remote server, and this is working perfectly fine when I run the app from Visual Studio 2010. However, when I...
10 Oct 2012 by Erick Dee
Found out what the problem was. The remote server was denying me access (401) because I was sending the DefaultCredentials in the WebClient object. It turns out that they're not the same when using the ASP Development server (your Windows account) than those sent by IIS when the app is deployed,...
22 Nov 2013 by NeonMika
Hi codeproject-community!I'm just diggin' into the TAP and I'm hoping you can help me with a problem.Let me first explain what I want to achieve:I want to read from a RSS-feed every 10 seconds and want to write it's items to output it somehow on my form.My idea:I wrote an...
22 Nov 2013 by bowlturner
And why can't you just use System.Threading.Thread.Sleep(10000); in the while (!cancellationToken.IsCancellationRequested) Block?As far as how to wait for the GetRssItems you can use the ContinueWith to call a 'finish' or 'next' I have thisprivate void StartTask(long...
22 Nov 2013 by NeonMika
Okay, after reading some blogs i found some solution that work's pretty good for me: private Action getRss = null; private TaskScheduler ui = TaskScheduler.FromCurrentSynchronizationContext(); public ObservableCollection GuiListRssItems = new...
21 Apr 2013 by Eduardo Antonio Cecilio Fernandes
Add asynchronous tasks, using threads, in Android activities while updating its progress to the UI. Use this technique for SDKs lower than 1.5.
5 Dec 2015 by Krishna P Seetharaman
How to expose multiple operations of an orchestration as multiple methods in a single web service(.asmx). Also explains how to use asynchronous approach in calling these web methods. We can add more methods to the orchestration and these new methods will be visible in the same web service
26 Jul 2023 by 1f604
Source code and explanation of my io_uring based implementation of b3sum