Most voted "async" questions
Asynchronous programming is simply to allow certain portions of code to be executed by separate threads.
Learn more…153 questions
Sort by count of
-
29
votes7
answers9251
viewsIn C#, what is the await keyword for?
I was studying this documentation about Asp.net Identity, and in the examples in C# has a keyword that I don’t know, which is the await, example : [HttpPost] [AllowAnonymous]…
-
20
votes3
answers2015
viewsWhat is the difference between async, multithreading, parallelism and competition?
What is the difference between async, multithreading, etc..? They depend on the amount of processor cores? If I do a program in Visual Basic and open 33 instances of it, would it be running in…
-
19
votes1
answer5560
viewsAbout the boolean attribute Defer and async vs optimization
The use of async and defer for optimization is a good subject to touch when we want pages loaded more quickly and also without blocking problems. Doubts: Using async, if the browser does not…
-
18
votes3
answers6637
viewsRun PHP function asynchronously
Using PHP, it is possible to run a function asynchronously? Example: The client(browser) makes a request to the server, in this request PHP executes an asynchronous function that may take a few…
-
15
votes2
answers5495
viewsWhat are Async methods?
I noticed that most methods in C# have an equal method but with a name async. What are these methods and how they work?
-
15
votes3
answers2510
viewsWhen not to return Task in async methods?
Normally, in some time-consuming tasks, I use asynchronous methods: public async Task myLongRunningOperation(int i) { ... } However, in what situations I don’t necessarily need to return a Task?…
-
13
votes2
answers8777
viewsDelete Javascript and Render Lock CSS?
Analyzing link in Pagespeed occurred the following warning Delete Javascript and CSS from blocking rendering content above the edge Basic layout <!DOCTYPE html> <html lang=pt-br>…
-
10
votes5
answers2656
viewsHow to manage a Sqlite connection between multiple simultaneous threads?
So I’m facing some problems with my Sqlite connection, where I’m not finding a skilled solution. Setting My scenario is this:: I synchronize the data of my application with a legacy system, through…
-
9
votes2
answers1921
viewsAsync operations on ASP.NET
When it is advantageous to use asynchronous operations in an application ASP.NET (classic, MVC, MVC Web API)? When do I use the ThreadPool to perform some operations may be useful?…
-
9
votes1
answer515
viewsWhat are the pros and cons of the Task<List<Object>> implementation on List<Object>
What are the advantages between the two implementations below. Both return a list with multiple products (more than 1k): public Task<List<Product>> GetAllProductsAsync() { var query =…
-
8
votes1
answer178
viewsHow to improve this: Hell callback?
I am finishing the development of an ad system, the system uses the redis server to save data and display campaigns directly from ram memory, since the pathology of these systems require a lot of…
-
7
votes3
answers3385
viewsWhat are asynchronous processing and synchronous processing?
I’m having this doubt while I’m studying about the class Handler. In the book it says that when a Thread is being used to perform some asynchronous processing and need to update the graphical…
-
7
votes1
answer86
viewsHow does async/await work in Rust?
The idea of async/await has become common in several languages (C#, Javascript etc). It seems that Rust recently (in the 2018 edition of Rust) adopted the idea of async/await, together with the…
-
7
votes1
answer430
viewsUsing synchronous methods together with asynchrons
For development reasons, I needed to create a call to an asynchronous method in a synchronous method, but when publishing my project on the server, it is indefinitely running. Asynchronous method…
-
6
votes2
answers257
viewsAsynctask x Multithreading
When it is most advantageous to use Asynctask, and when to use Threads. For example: Download a file (e.g., JSON). Which would be more advantageous in this case and why??…
-
6
votes2
answers429
viewsHow to filter a list asynchronously using LINQ?
Example of code without the use of async: var products = db.Products.Where(_ => _.UserId == currentUserId); How do I make this asynchronous query taking into account that the Where of Linq does…
-
6
votes1
answer201
viewsDoes the keyword "async" really make the asynchronous method?
I was seeing a video (at 31:11 minutes) and there says that async does not make the method really asynchronous, it is more a "hint". As it was in English and I am not totally advanced, it was half…
-
6
votes2
answers782
viewsHow to create a Restful API with asynchronous processing and response using C# + Angular(v5+)
Hello, I am working with C# and I have the following problem: Imagine I have a route to my API api/estoque/inventario where this route should make the calculation of the inventory of the entire…
-
5
votes3
answers2713
viewsASP.NET MVC5 - Asynchronous Methods in Controller
I’m developing an MVC layer for an ASP.NET system written initially in Webforms. It does not use Entityframework, so a good part of the system I had to elaborate a home solution. In order to use the…
-
5
votes2
answers188
viewsC# Difference between Beginaccept and Acceptasync
What is the difference between the two asynchronous forms? Which has better performance handling sockets and handling thousands of connection simultaneously? Example for Beginxxx:…
-
5
votes1
answer560
viewsReport progress to the interface of an asynchronous method in C#
I have an app Windows Forms. This application will perform some processes that take some time to execute, so I would like to run them in parallel. Follows a little of what I’m trying to implement.…
-
5
votes1
answer349
viewsDoes Task.Run always start a new Thread?
When executing a list of tasks initiated through Task.Run, it is ensured that each one is executed in a different Thread? When reading the documentation, it seems to me that this is the default…
-
5
votes2
answers651
viewsDifference is between Backgroundworker and Task.Run()?
Usually when I had to do some operation on background, mainly involving progress bar update or Labels I used to use the BackgroundWorker, with your events WorkerReportsProgressand DoWork. I recently…
-
5
votes2
answers1906
viewsawait Task.Whenall how to run multiple processes?
I am trying to create several task (async) they will perform the following logic: Parse an Html based on a received url with Htmlagilitypack Return a product model after parse Insert the Product…
-
5
votes1
answer1242
viewsAre there differences between the terms Thread, Multithread, Async and Await?
I asked that question here at Stack Ooverflow: What is the solution for asynchronous PHP processes? I did it because I wanted that in the middle of a process execution, I wanted to have a certain…
terminology thread multithreading async asynchronousasked 7 years, 5 months ago Wallace Maxters 102,340 -
5
votes2
answers2000
viewsWhat is the difference between async Task and void?
I use async Task with await when I need my code to wait for such a task to complete until it performs another process. In the case of methods void, without async-await, my code also does not "wait"…
-
5
votes2
answers1688
viewsWill using async="" result in synchronous or asynchronous loading?
I am using this function to load my scripts in a single row: function loadJS () { for (var i = 1, max = arguments.length; i < max; i++) { var file = document.createElement("script"); file.async =…
-
5
votes1
answer124
viewsAsync methods - return string from UDP
I am developing a code whose goal is to send a package with a string in broadcast and then read the answer (if any), however I want to create a method that just returns the string of the answer. I…
-
5
votes1
answer752
viewsWhat’s the difference between "Future.whenComplete" and "Future.then"?
The Dart language provides several mechanisms for handling asynchronous calls. One I’m very used to is modifying await, which can be used in functions marked as async. However, we are sometimes in a…
-
5
votes1
answer175
viewsHow competition works on a single thread with C#
This is a purely didactic question. I’m trying to understand how the competition model works in C#, specifically by using the async modifier. I come from Javascript, and I understand that in the JS…
-
4
votes1
answer662
viewsNo Auto-Increment Primary Key for CPF in Entity Framework
The scenario is as follows: I have an Employee class. A primary key of it must be the employee CPF that the user type. The Problem: the key follows a default auto increment, not going according to…
-
4
votes1
answer117
viewsrecharge design material effects
I have a site with material design, but when I update the html of the page with XHR the new content loses the effect of javascript as I could to reload mdl? To make the change between the view, I…
-
4
votes1
answer533
viewsWhat is the difference between Task and async Task?
In the code below I wrote two methods, one with the return Task and another async Task. What happens differently in the execution of these methods since for one added in the construction the…
-
3
votes1
answer737
viewsLoop asynchronous calls and process data at the end of all runs
I have a method of web service which receives the IP of a server as a parameter and returns a DataSet. Several servers must be consulted by this web service, Um List<string> contains the list…
-
3
votes1
answer1543
viewsCorrect use of async and await in Asp.Net
I am creating an asynchronous method for sending Emails from the opening or changing of the object, but when calling the method of sending email I have to put the await in front and the return of…
-
3
votes1
answer205
viewsAsynchronous server responses for AJAX calls
I have an application that at the end of a page loading I make an AJAX request that takes around 20 seconds. After this request my page keeps working normally so that when I try to make another AJAX…
-
3
votes1
answer274
viewsHow to develop an asynchronous mechanism to test pings?
I have a problem of slowness in a transaction that usually performs pings to check if certain IP’s are accessible. It turns out that this transaction tests more than 20 different IP’s, which makes…
-
3
votes3
answers682
viewsWhat is the difference between Smtpclient.Sendasync and Smtpclient.Send() using Thread?
What difference between using SmtpClient.SendAsync() and create threads and execute the SmtpClient.Send() for messaging? There is a lot of difference in performance or resource consumption?…
-
3
votes2
answers805
viewsAsynctask task only runs once, then does not arrive at theInBackground
I am facing a strange problem in my application, since in I am testing in 4 different devices but only two of them have the expected behavior. Scenario / Devices: Nexus 4 / Android 5.0 - OK Galaxy…
-
3
votes1
answer127
viewsHow does Javascript’s async attributo work?
I was reading about the attribute async, which is used in the tag <script>, and I got curious and doubtful about some things. According to the W3school: A script that will be run…
-
3
votes1
answer1004
viewsCapture value of an asynchronous function in Nodejs
Hello, I have a problem I haven’t found a solution. I have an array of values, in which I scan and for each value run function that makes a request to dynamodb and returns a JSON. This request is…
-
3
votes1
answer99
viewsHow to create an asynchronous method that is cancellable?
How to create an asynchronous method that is cancellable? In this context, the DoFoo() does things that cannot simply be stopped, like reading and writing files, and when canceling, I have to wait…
-
3
votes1
answer145
viewsIgnored await in asynchronous method c#
I need to use the return of an asynchronous method for validation but even with the use of "await" the method is still running before I receive the return of the function. var teste = await new…
-
3
votes1
answer109
viewsHow to use await instead of . then() in Javascript?
I have this asynchronous code: const delay = () => new Promise(resolve => setTimeout(resolve, 1000)); async function umPorSegundo(){ console.log(await delay(), '1s') console.log(await delay(),…
-
3
votes1
answer1242
viewsDownload async with Webclient.Downloadfileasync
Today I have a class that downloads photos, but as there are many photos always above 5mil think I could take advantage with async method. Process multiple task at the same time. But I think I’m…
-
3
votes1
answer274
viewsUse of async with . NET Core and nhibernate
No. NET Core I know we have the async and await for request async. So far so good, but many frameworks in the market are creating methods with the signature MetodoAsync() and has the method without…
-
3
votes2
answers784
viewsProblem accessing Json API with React
I am trying to access the following variable in the Json of an API: page[0].infoBloco[0].tabela[0].dados[0].fonte.nome I’m getting the bug: TypeError: this.state.page[0] is undefined[Learn More]…
-
3
votes1
answer183
viewsIs it possible to define async as the initializer method of a Python class?
Let’s say I have a class where I need to initialize a field with the return of a corotina: import asyncio class Server: def __init__(self): self.connection = await self.connect() async def…
-
3
votes1
answer100
viewsAsync functions inside setInterval giving Syntax Error in HTML
Good morning/evening guys, I’m having a really boring problem, I’m creating a website for a school biology project, about cells. On this site I have to make a loop that performs an action, wait X…
-
2
votes3
answers1461
viewsHow to update Textview from Asynctask?
I saw in this example, updating the field TextView from within the AsyncTask but I can’t repeat that in my code, and it seems to me that’s not even possible or it’s? protected String…