Questions tagged [asynchronous-programming]
The asynchronous-programming tag has no summary.
184 questions
5votes
2answers
480views
How is async implemented natively?
How is async logic implemented natively without threads? What would be the high level structure of the system? Is it just a separate OS thread that gets and pushes requests and results in 2 queues? I ...
8votes
5answers
4kviews
Expensive constructors. Should they exist? Should they be replaced?
Suppose I have a constructor that performs an expensive IO operation that takes a noticeable amount of time. I don't like it for a few reasons (first of all, it's simply wrong, but there are practical ...
1vote
1answer
365views
What does it mean to be "truly" asynchronous?
Reading the Proactor pattern paper, specifically this part: I/O Completion Ports in Windows NT: The Windows NT operating system implements the Proactor pattern. Various Asynchronous Operations such ...
4votes
3answers
1kviews
Not await an asynchronous method because it is like an endless loop - good practice?
I inherited a piece of software. This program is connected to an external hardware, which is a measurement device. Every 100 milliseconds, a value is read from this device and displayed to the user. ...
1vote
2answers
628views
How can I code synchronous programs in Node?
I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node. I understand the asynchronous features are useful in many situations, but when I debug my code,...
1vote
5answers
286views
Purpose of async/await in web servers when stuck with legacy I/O
A couple days ago I asked about the Purpose of async/await in web servers, and got in-depth answers explaining how in fully asynchronous code, it frees up the CPU completely while also releasing the ...
23votes
4answers
8kviews
Purpose of async/await in web servers
I don't understand why I keep seeing async/await recommended (or sometimes, even enforced) for ASP.NET Core web applications and APIs. As far as I can tell, every request is already being run on a ...
0votes
1answer
120views
In Java's Fork/Join is the operation for combining results limited to addition?
As I understand it, the join() method merge/composes/combines the results from all subtasks. A simple example I saw was summing the numbers from 1 to N and the subtasks would simply sum a range of ...
1vote
0answers
368views
How to structure your Python code with asynchronous and synchronous parts
I have a Python FastAPI server application which naturally guides you towards the asynchronous paradigm. For legacy reasons, I have to support two backends, one which is purely synchronous and one ...
1vote
1answer
115views
Return function after kicking off background process
I have a process in golang that I want to kickoff through a RPC call but then have the function return early whilst the process continues in the background. Specifically it’s just a basic db transfer ...
3votes
3answers
650views
What is the best way to retain a local object which is performing an asynchronous task?
My problem is the following: inside a method I'm creating an object like this: MyObject* myObject = [MyObject new]; Then I want it to perform an asynchronous task like this: [myObject ...
0votes
0answers
51views
How to handle multi-region writes for a joint user registration?
UserA and UserB are signing up for some joint service together. They both have to independently agree to T&Cs before sign-up is complete. Once complete they both receive an email to sign-in. A 1 ...
1vote
0answers
263views
If you run a function in a different thread, but you wait for it to finish in your main thread, is that function asynchronous?
Backstory Probably a stupid question, but I just have a sneaking suspicion that "asynchronous" is the wrong terminology to us for naming my template function here: template <class T> ...
0votes
1answer
104views
How are asynchoronous problems handled with imperative programming?
Context To level set, I've been working with OOP and FP for my whole career, so my experience with the imperative paradigm is limited. The team I joined is made up of very senior (20+ years xp) ...
3votes
3answers
6kviews
Synchronous vs Asynchronous Event Driven Architecture
I have been searching extensively about the difference between synchronous and asynchronous patterns and how this relates to event driven architecture. On its face it is quite obvious, I simply ...