Difference between asynchronous and synchronous in C#

 


Difference between asynchronous and synchronous in C#


Before we jump into the juicy stuff, let’s start by clarifying the difference between asynchronous and synchronous programming.

In synchronous operations tasks are performed one at a time and only when one is completed, the following is unblocked. In other words, you need to wait for a task to finish to move to the next one. 

In asynchronous operations, on the other hand, you can move to another task before the previous one finishes. This way, with asynchronous programming you’re able to deal with multiple requests simultaneously, thus completing more tasks in a much shorter period of time. 

Synchronous Programming

  • Synchronous represents a set of activities that starts happening together at the same time.
  • the synchronous call waits for the method to complete before continuing with the program flow
How bad is it?
  • It badly impacts the UI that has just one thread to run its entire user interface code.
  • Synchronous behavior leaves end users with a bad user experience and a blocked UI whenever the user attempts to perform some lengthy (time-consuming) operation.

OutSystems Asynchronous Capabilities

OutSystems is a modern, AI-powered application platform that offers several in-built asynchronous capabilities:

  • Timers: Timers are meant to perform routine tasks like sending emails that are scheduled on a daily basis like a digest but also long and heavy processing tasks. If you want to prep data to use after publishing an app, you can also use timers to perform bootstrap logic and they are also recommended to process large chunks of information that take some time to execute (20-30min).       
  • Business Process Technology (BPT): This capability is  available to define and execute business processes over apps built with OutSystems. BPT performs system-to-systems and human-to-systems interactions. It  also supports business workflows and is able to perform multiple activities per process. Those activities can be automatic or human activities.
  • Light Processes: Light processes are event-driven processes. You can think of them as triggers. Light processes are meant to handle several thousand events per day, like as event brokers that require scalable database queuing. Compared with BPT, they only support one activity inside each process and it must be an automatic activity.     

In addition to that, there are a few other capabilities important to note:

  • Retry on error: If an error happens, timers and processes will retry up to three times.
  • Timeout protection: Timeout protection prevents a background process to run infinitely, allowing resources usage control.
  • Queue management: Queues are managed automatically by the platform, removing the need to worry about queuing background processes. 
  • Scalability vs parallelization: Processes that are queued in the background are distributed by the front-end automatically, so you don’t need to worry about that.
  • Isolation: Background processes can be isolated per front-end for both cloud and on-premises infrastructures or per zone if you’re dealing with infrastructure on-premise only. This provides you an additional layer of security.


Comments

Popular posts from this blog

Why companies choose Kotlin over java for server-side development ?