SlideShare a Scribd company logo
1 of 18
What is Synchronous programming?
In programming, synchronous programs allocate a single thread to handle a request
or complete a task.
Since synchronous operations happen one at a time, a painstakingly long task
like a database query will block all other threads in the meantime.
While asynchronous operations can run multiple tasks concurrently on a single
thread, synchronous programs have a task queue where every other task remains
idle while the first is completed.
By definition, synchronous means ‘connected’ or ‘dependent’. In essence,
synchronous communication is tightly coupled.
For reactive systems, when programs work best when they react to environmental
input, synchronous programs can be useful
What is Synchronous programming?
Synchronous programs use blocking I/O operations in which each operation
has to run before the next is executed.
Generally, computers are fast, so synchronous communication isn’t necessarily
disadvantageous.
However, in a real-life, non-technical application, this would be the equivalent of your
waiter refusing to bring out any of the dishes you ordered until each and every dish
were fully prepared.
Benefits of Synchronous programming?
Synchronous programming is well-supported amongst all programming languages.
Developers do not have to worry about whether it is possible to code asynchronous
applications as this is the default.
Plus, writing synchronous programs is objectively easier than writing asynchronous
programs.
In utilizing a blocking I/O architecture you can save time in the software development
process and run tests with fewer complications.
Benefits of Synchronous programming?
Search engines find it easier to crawl for web pages that make use of traditional
synchronous architecture.
For marketers who depend on search engine optimization (SEO) to build their
reputation and brand awareness, this is an appreciable advantage.
What is Asynchronous programming?
Asynchronous programming relies on a non-blocking input and output (I/O) protocol.
This signifies that an asynchronous program does not execute operations in a
hierarchical or sequential order.
The resulting parallelization means an asynchronous program can take on multiple
requests simultaneously and independently.
When one request fails, it has no effect on another request. And the program can
move to another task before finishing the last.
In software development, an advantage of this kind is called loose coupling. Loosely
coupled communication and/or programming allows for decentralized processes.
What is Asynchronous programming?
Fewer dependencies lead to higher fault tolerance and increased flexibility.
For businesses that prioritize getting things done, asynchronous programming can be
a fundamental building block in meeting project requirements.
Imagine a non-technical example of how asynchronous communication would look
like in a real-world scenario.
As an illustration, envision you’re at a restaurant. Your waiter has just taken multiple
orders at your table and brings out your appetizer as soon as it’s ready, instead of
waiting for your main entree to be prepared as well.
Not only is this simply efficient service, but it’s an exemplary demonstration of a non-
blocking I/O or asynchronous architecture.
Benefits of Asynchronous programming?
In comparing asynchronous and synchronous programming, asynchronous programs
improve user experience in a variety of ways.
First, all the scripts of a program or web page can load at one time, resulting in better
responsiveness and decreased page load delays.
And the failure of a thread has no consequence on the ability of other threads to run
or render. Therefore, there is more availability overall with asynchronous
applications.
Benefits of Asynchronous programming?
In practice, asynchronous programming requires writing callback functions in
line with errors that may occur and disrupt a program.
These callbacks instruct the machine to move past the error and run the next task.
This also gives programmers the opportunity to write a personalized error message.
As a result, errors do not mean that your program altogether fails to run. Users get a
nice note while all the other features of the program work just fine.
Use case of Synchronous vs Asynchronous
For example if you want to download a file from the internet you might use a
synchronous function to do that but it will block your thread until the file finished
downloading. This can make your application unresponsive to any user input.
Instead you could download the file in the background using asynchronous
method. In this case the download function returns immediately and program
execution continues normally. All the download operations are done in the
background and your program will be notified when it's finished.
Use case of Synchronous vs Asynchronous
When you execute something synchronously, you wait for it to finish before moving
on to another task. When you execute something asynchronously, you can move
on to another task before it finishes.
Synchronous execution means the execution happens in a series a->b->c->d. If
you are calling methods ‘a ‘will run first and then when ‘a’ finish then ‘b’ will start.
With Asynchronous execution , you can start with ‘a’, and then ‘a’ can go in
background and we don’t need to wait for ‘a’ to finish, ‘b’ can start parallely.
Use case of Synchronous vs Asynchronous
The biggest contribution that asynchronous programming provides is enhanced
throughput.
Throughput refers to the deliverables a product or company can produce
within a specified time.
As established, computers are fast. Thus, synchronous programming is not as
time-consuming as you might imagine.
If you merely wish to develop a front-end application or execute a basic central
process unit (CPU) function, then asynchronous programming is way out of
bounds.
Use case of Synchronous
User Interfaces: User interface (UI) designs are typically synchronous. Since UIs
are spaces where humans and computers interact, it is ideal for them to replicate
the communication standards and practices humans are familiar with. Humans
expect an immediate response when they interact with a computer!
•HTTP APIs: HTTP APIs pass requests and responses in a synchronous fashion.
Client programs sending HTTP requests usually expect a fast answer from the
web server.
Use case of Asynchronous
•Batch-processing: is a data-processing method to handle large amounts of data
asynchronously. With asynchronous batch-processing, large batches of data are
processed at scheduled times to avoid blocking computing resources.
•Long-running tasks: such as fulfilling an order placed on an e-commerce site are
best handled asynchronously. There is no need to block resources while this task
is executed.
Summary
Synchronous and asynchronous, also known as sync and async, are
two types of programming models. At an abstract level, programming
models define how software is designed and executed.
The basic programming models are synchronous, but asynchronous
models are critical for performance reasons and to more efficiently use
computing resources. Programming languages usually have built-in
primitives to deal with asynchronous programming.
Asynchronous programming is a style of programming in which
the execution of a task is not guaranteed to occur in a
specific order. This contrasts with synchronous programming,
where all code execution is guaranteed to happen in a
specific order.
THANK YOU
Like the Video and Subscribe the Channel

More Related Content

What's hot

Reader/writer problem
Reader/writer problemReader/writer problem
Reader/writer problemRinkuMonani
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's typesNishant Joshi
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidancewahab13
 
Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipeliningMazin Alwaaly
 
Multithreading
MultithreadingMultithreading
MultithreadingA B Shinde
 
advanced computer architesture-conditions of parallelism
advanced computer architesture-conditions of parallelismadvanced computer architesture-conditions of parallelism
advanced computer architesture-conditions of parallelismPankaj Kumar Jain
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed SystemsPritom Saha Akash
 
Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAdeel Rasheed
 

What's hot (20)

Parallel processing
Parallel processingParallel processing
Parallel processing
 
Reader/writer problem
Reader/writer problemReader/writer problem
Reader/writer problem
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's types
 
Memory management
Memory managementMemory management
Memory management
 
System calls
System callsSystem calls
System calls
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
Deadlock Avoidance in Operating System
Deadlock Avoidance in Operating SystemDeadlock Avoidance in Operating System
Deadlock Avoidance in Operating System
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
 
advanced computer architesture-conditions of parallelism
advanced computer architesture-conditions of parallelismadvanced computer architesture-conditions of parallelism
advanced computer architesture-conditions of parallelism
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Input output module
Input output moduleInput output module
Input output module
 
Interrupts and types of interrupts
Interrupts and types of interruptsInterrupts and types of interrupts
Interrupts and types of interrupts
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 

Similar to Synchronous vs Asynchronous Programming

AsyncIO in Python (Guide and Example).pdf
AsyncIO in Python (Guide and Example).pdfAsyncIO in Python (Guide and Example).pdf
AsyncIO in Python (Guide and Example).pdfPreetAujla6
 
Interactive Applications in .NET
Interactive Applications in .NETInteractive Applications in .NET
Interactive Applications in .NETAndrei Fangli
 
Concurrency and Parallelism, Asynchronous Programming, Network Programming
Concurrency and Parallelism, Asynchronous Programming, Network ProgrammingConcurrency and Parallelism, Asynchronous Programming, Network Programming
Concurrency and Parallelism, Asynchronous Programming, Network ProgrammingPrabu U
 
5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptxMohamedBilal73
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programmingAshwini Awatare
 
Types or evolution of operating system
Types or evolution of operating systemTypes or evolution of operating system
Types or evolution of operating systemEkta Bafna
 
Understanding concurrency
Understanding concurrencyUnderstanding concurrency
Understanding concurrencyAnshul Sharma
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1MSc CST
 
Operating systems
Operating systemsOperating systems
Operating systemsoswaldm80
 
Distributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingDistributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingHaseeb Rehman
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5Kunal Bangar
 
Web services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousWeb services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousAravindharamanan S
 

Similar to Synchronous vs Asynchronous Programming (20)

AsyncIO in Python (Guide and Example).pdf
AsyncIO in Python (Guide and Example).pdfAsyncIO in Python (Guide and Example).pdf
AsyncIO in Python (Guide and Example).pdf
 
Asynchronyin net
Asynchronyin netAsynchronyin net
Asynchronyin net
 
Report hospital
Report hospitalReport hospital
Report hospital
 
Interactive Applications in .NET
Interactive Applications in .NETInteractive Applications in .NET
Interactive Applications in .NET
 
Concurrency and Parallelism, Asynchronous Programming, Network Programming
Concurrency and Parallelism, Asynchronous Programming, Network ProgrammingConcurrency and Parallelism, Asynchronous Programming, Network Programming
Concurrency and Parallelism, Asynchronous Programming, Network Programming
 
Lec2.pptx
Lec2.pptxLec2.pptx
Lec2.pptx
 
5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx5.7 Parallel Processing - Reactive Programming.pdf.pptx
5.7 Parallel Processing - Reactive Programming.pdf.pptx
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programming
 
os ass.pptx
os ass.pptxos ass.pptx
os ass.pptx
 
Types or evolution of operating system
Types or evolution of operating systemTypes or evolution of operating system
Types or evolution of operating system
 
Understanding concurrency
Understanding concurrencyUnderstanding concurrency
Understanding concurrency
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Distributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingDistributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server Computing
 
C# Async Await
C# Async AwaitC# Async Await
C# Async Await
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5
 
Concurrency in c#
Concurrency in c#Concurrency in c#
Concurrency in c#
 
Web Services in SOA | Torry Harris
Web Services in SOA | Torry HarrisWeb Services in SOA | Torry Harris
Web Services in SOA | Torry Harris
 
Web services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronousWeb services-synchronous-or-asynchronous
Web services-synchronous-or-asynchronous
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 

More from jeetendra mandal

Eventual consistency vs Strong consistency what is the difference
Eventual consistency vs Strong consistency what is the differenceEventual consistency vs Strong consistency what is the difference
Eventual consistency vs Strong consistency what is the differencejeetendra mandal
 
Batch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing DifferenceBatch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing Differencejeetendra mandal
 
Difference between Database vs Data Warehouse vs Data Lake
Difference between Database vs Data Warehouse vs Data LakeDifference between Database vs Data Warehouse vs Data Lake
Difference between Database vs Data Warehouse vs Data Lakejeetendra mandal
 
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long PollingDifference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long Pollingjeetendra mandal
 
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...jeetendra mandal
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Threadjeetendra mandal
 
Carrier Advice for a JAVA Developer How to Become a Java Programmer
Carrier Advice for a JAVA Developer How to Become a Java ProgrammerCarrier Advice for a JAVA Developer How to Become a Java Programmer
Carrier Advice for a JAVA Developer How to Become a Java Programmerjeetendra mandal
 
How to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Tester Carrier Path for Software Quality TesterHow to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Tester Carrier Path for Software Quality Testerjeetendra mandal
 
How to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software DeveloperHow to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software Developerjeetendra mandal
 
Microservice Architecture Software Architecture Microservice Design Pattern
Microservice Architecture Software Architecture Microservice Design PatternMicroservice Architecture Software Architecture Microservice Design Pattern
Microservice Architecture Software Architecture Microservice Design Patternjeetendra mandal
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Patternjeetendra mandal
 
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...jeetendra mandal
 
Observability vs APM vs Monitoring Comparison
Observability vs APM vs  Monitoring ComparisonObservability vs APM vs  Monitoring Comparison
Observability vs APM vs Monitoring Comparisonjeetendra mandal
 
Disaster Recovery vs Data Backup what is the difference
Disaster Recovery vs Data Backup what is the differenceDisaster Recovery vs Data Backup what is the difference
Disaster Recovery vs Data Backup what is the differencejeetendra mandal
 
What is Spinnaker? Spinnaker tutorial
What is Spinnaker? Spinnaker tutorialWhat is Spinnaker? Spinnaker tutorial
What is Spinnaker? Spinnaker tutorialjeetendra mandal
 
Difference between Github vs Gitlab vs Bitbucket
Difference between Github vs Gitlab vs BitbucketDifference between Github vs Gitlab vs Bitbucket
Difference between Github vs Gitlab vs Bitbucketjeetendra mandal
 

More from jeetendra mandal (20)

what is OSI model
what is OSI modelwhat is OSI model
what is OSI model
 
What is AWS Cloud Watch
What is AWS Cloud WatchWhat is AWS Cloud Watch
What is AWS Cloud Watch
 
What is AWS Fargate
What is AWS FargateWhat is AWS Fargate
What is AWS Fargate
 
Eventual consistency vs Strong consistency what is the difference
Eventual consistency vs Strong consistency what is the differenceEventual consistency vs Strong consistency what is the difference
Eventual consistency vs Strong consistency what is the difference
 
Batch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing DifferenceBatch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing Difference
 
Difference between Database vs Data Warehouse vs Data Lake
Difference between Database vs Data Warehouse vs Data LakeDifference between Database vs Data Warehouse vs Data Lake
Difference between Database vs Data Warehouse vs Data Lake
 
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long PollingDifference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
 
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Thread
 
Carrier Advice for a JAVA Developer How to Become a Java Programmer
Carrier Advice for a JAVA Developer How to Become a Java ProgrammerCarrier Advice for a JAVA Developer How to Become a Java Programmer
Carrier Advice for a JAVA Developer How to Become a Java Programmer
 
How to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Tester Carrier Path for Software Quality TesterHow to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Tester Carrier Path for Software Quality Tester
 
How to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software DeveloperHow to become a Software Engineer Carrier Path for Software Developer
How to become a Software Engineer Carrier Path for Software Developer
 
Events vs Notifications
Events vs NotificationsEvents vs Notifications
Events vs Notifications
 
Microservice Architecture Software Architecture Microservice Design Pattern
Microservice Architecture Software Architecture Microservice Design PatternMicroservice Architecture Software Architecture Microservice Design Pattern
Microservice Architecture Software Architecture Microservice Design Pattern
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Pattern
 
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
 
Observability vs APM vs Monitoring Comparison
Observability vs APM vs  Monitoring ComparisonObservability vs APM vs  Monitoring Comparison
Observability vs APM vs Monitoring Comparison
 
Disaster Recovery vs Data Backup what is the difference
Disaster Recovery vs Data Backup what is the differenceDisaster Recovery vs Data Backup what is the difference
Disaster Recovery vs Data Backup what is the difference
 
What is Spinnaker? Spinnaker tutorial
What is Spinnaker? Spinnaker tutorialWhat is Spinnaker? Spinnaker tutorial
What is Spinnaker? Spinnaker tutorial
 
Difference between Github vs Gitlab vs Bitbucket
Difference between Github vs Gitlab vs BitbucketDifference between Github vs Gitlab vs Bitbucket
Difference between Github vs Gitlab vs Bitbucket
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Synchronous vs Asynchronous Programming

  • 1.
  • 2.
  • 3. What is Synchronous programming? In programming, synchronous programs allocate a single thread to handle a request or complete a task. Since synchronous operations happen one at a time, a painstakingly long task like a database query will block all other threads in the meantime. While asynchronous operations can run multiple tasks concurrently on a single thread, synchronous programs have a task queue where every other task remains idle while the first is completed. By definition, synchronous means ‘connected’ or ‘dependent’. In essence, synchronous communication is tightly coupled. For reactive systems, when programs work best when they react to environmental input, synchronous programs can be useful
  • 4. What is Synchronous programming? Synchronous programs use blocking I/O operations in which each operation has to run before the next is executed. Generally, computers are fast, so synchronous communication isn’t necessarily disadvantageous. However, in a real-life, non-technical application, this would be the equivalent of your waiter refusing to bring out any of the dishes you ordered until each and every dish were fully prepared.
  • 5. Benefits of Synchronous programming? Synchronous programming is well-supported amongst all programming languages. Developers do not have to worry about whether it is possible to code asynchronous applications as this is the default. Plus, writing synchronous programs is objectively easier than writing asynchronous programs. In utilizing a blocking I/O architecture you can save time in the software development process and run tests with fewer complications.
  • 6. Benefits of Synchronous programming? Search engines find it easier to crawl for web pages that make use of traditional synchronous architecture. For marketers who depend on search engine optimization (SEO) to build their reputation and brand awareness, this is an appreciable advantage.
  • 7. What is Asynchronous programming? Asynchronous programming relies on a non-blocking input and output (I/O) protocol. This signifies that an asynchronous program does not execute operations in a hierarchical or sequential order. The resulting parallelization means an asynchronous program can take on multiple requests simultaneously and independently. When one request fails, it has no effect on another request. And the program can move to another task before finishing the last. In software development, an advantage of this kind is called loose coupling. Loosely coupled communication and/or programming allows for decentralized processes.
  • 8. What is Asynchronous programming? Fewer dependencies lead to higher fault tolerance and increased flexibility. For businesses that prioritize getting things done, asynchronous programming can be a fundamental building block in meeting project requirements. Imagine a non-technical example of how asynchronous communication would look like in a real-world scenario. As an illustration, envision you’re at a restaurant. Your waiter has just taken multiple orders at your table and brings out your appetizer as soon as it’s ready, instead of waiting for your main entree to be prepared as well. Not only is this simply efficient service, but it’s an exemplary demonstration of a non- blocking I/O or asynchronous architecture.
  • 9. Benefits of Asynchronous programming? In comparing asynchronous and synchronous programming, asynchronous programs improve user experience in a variety of ways. First, all the scripts of a program or web page can load at one time, resulting in better responsiveness and decreased page load delays. And the failure of a thread has no consequence on the ability of other threads to run or render. Therefore, there is more availability overall with asynchronous applications.
  • 10. Benefits of Asynchronous programming? In practice, asynchronous programming requires writing callback functions in line with errors that may occur and disrupt a program. These callbacks instruct the machine to move past the error and run the next task. This also gives programmers the opportunity to write a personalized error message. As a result, errors do not mean that your program altogether fails to run. Users get a nice note while all the other features of the program work just fine.
  • 11.
  • 12. Use case of Synchronous vs Asynchronous For example if you want to download a file from the internet you might use a synchronous function to do that but it will block your thread until the file finished downloading. This can make your application unresponsive to any user input. Instead you could download the file in the background using asynchronous method. In this case the download function returns immediately and program execution continues normally. All the download operations are done in the background and your program will be notified when it's finished.
  • 13. Use case of Synchronous vs Asynchronous When you execute something synchronously, you wait for it to finish before moving on to another task. When you execute something asynchronously, you can move on to another task before it finishes. Synchronous execution means the execution happens in a series a->b->c->d. If you are calling methods ‘a ‘will run first and then when ‘a’ finish then ‘b’ will start. With Asynchronous execution , you can start with ‘a’, and then ‘a’ can go in background and we don’t need to wait for ‘a’ to finish, ‘b’ can start parallely.
  • 14. Use case of Synchronous vs Asynchronous The biggest contribution that asynchronous programming provides is enhanced throughput. Throughput refers to the deliverables a product or company can produce within a specified time. As established, computers are fast. Thus, synchronous programming is not as time-consuming as you might imagine. If you merely wish to develop a front-end application or execute a basic central process unit (CPU) function, then asynchronous programming is way out of bounds.
  • 15.
  • 16. Use case of Synchronous User Interfaces: User interface (UI) designs are typically synchronous. Since UIs are spaces where humans and computers interact, it is ideal for them to replicate the communication standards and practices humans are familiar with. Humans expect an immediate response when they interact with a computer! •HTTP APIs: HTTP APIs pass requests and responses in a synchronous fashion. Client programs sending HTTP requests usually expect a fast answer from the web server. Use case of Asynchronous •Batch-processing: is a data-processing method to handle large amounts of data asynchronously. With asynchronous batch-processing, large batches of data are processed at scheduled times to avoid blocking computing resources. •Long-running tasks: such as fulfilling an order placed on an e-commerce site are best handled asynchronously. There is no need to block resources while this task is executed.
  • 17. Summary Synchronous and asynchronous, also known as sync and async, are two types of programming models. At an abstract level, programming models define how software is designed and executed. The basic programming models are synchronous, but asynchronous models are critical for performance reasons and to more efficiently use computing resources. Programming languages usually have built-in primitives to deal with asynchronous programming. Asynchronous programming is a style of programming in which the execution of a task is not guaranteed to occur in a specific order. This contrasts with synchronous programming, where all code execution is guaranteed to happen in a specific order.
  • 18. THANK YOU Like the Video and Subscribe the Channel