SlideShare a Scribd company logo
GlusterFS1
Concurrent is NOT Parallel
Joseph Fernandes
Senior Software Engineer, Red Hat Storage
GlusterFS2
Who am I ?
● Joseph Fernandes (Senior Software Engineer, Red Hat
Storage)
● Gluster Data Tiering
● YADL (Deduplication)
● Gluster Archival/Compliance – WORM/Retention
GlusterFS3
Agenda
● What is Concurrency ?
● What is Parallelism ?
● Concurrency with Parallelism
● Just Concurrent Not Parallel
● Advantages vs Disadvantages
● Programming Language support
● C
● C++
● GO
GlusterFS4
What is Concurrency?
Concurrency is about dealing with lots of things at
once.
GlusterFS5
What is Concurrency?
Masala Dosa
&
Coffee…. Hmmm
EAT
DRINK
LEAVE
Place order
Place order
Order
Ready
Order
Ready
GlusterFS6
What is Concurrency?
GlusterFS7
What is Parallelism?
Parallelism is about doing lots of things at once.
GlusterFS8
What is Parallelism?
Masala Dosa
&
Coffee…. Hmmm
EAT
DRINK
LEAVE
Place order
Place order
Order
Ready
Order
Ready
Waiting or
Doing
something
CLONE1
CLONE2
GlusterFS9
What is Parallelism?
GlusterFS10
Concurrency with Parallelism
Food
Order
Queue
Prepared
Food
Queue
Concurrent
Order Receiver
Concurrent
Dosa Master
Concurrent
Customer
Context
Switch
GlusterFS11
Concurrency with Parallelism
Concurrent
Customers
Food
Order
Queue
Prepared
Food
Queue
Concurrent + Parallel
Order Receivers
Concurrent + Parallel
Dosa Masters
GlusterFS12
Similarity with IO systems
Application
IO API
Blocking
IO Calls
Concurrent
IO Thread
Concurrent
IO Thread
Concurrent
IO Thread
IO Device
Interface
Thread 1
Thread 2
Thread 3
Context Memory
Context Memory
GlusterFS13
More Simplified ..
Thread1 {
Block1() {
Yield()
}
Continue
}
Thread2 {
Block2() {
Yield ()
}
Continue
}
Thread3 {
Block3() {
Yield ()
}
Continue
}
Context Memory
(Will be waked
when unblocked
error or success)
Concurrent
IO Thread
GlusterFS14
More Simplified
Context memory
Wakeup1()
Concurrent
IO Thread
Thread1
Wakeup2()
Thread2
Wakeup3()
Thread3
Sleep() until
Something
comes
In the context
memory
GlusterFS15
Just Concurrent Not Parallel
consume () {
char a = '';
while (a == getchar()) {
//do somehing with a
}
}
producer () {
{
char a = ''
while (doing something) {
a = somecompute to produce;
putchar (a);
}
}
Interesting problem : How do I communicate memory
without having multiple threads/processes?
GlusterFS16
Just Concurrent Not Parallel
Producer () produces 'a'
consumer () consumes 'a'
Producer () produces 'b'
consumer () consumes 'b'
Producer () produces 'EOF'
And returns
consumer () consumes 'EOF'
And returns
Thread 1
GlusterFS17
Co-routines
Coroutines are computer program components that generalize subroutines for
nonpreemptive multitasking, by allowing multiple entry points for suspending and
resuming execution at certain locations.
GlusterFS18
Advantages
● Improved performance and responsiveness
● More real-life approach of solving problems
● Code is more modular and hence less duplication
● Efficient use of Multi-Core CPUs
GlusterFS19
Things to remember
● Increase memory footprints
● Complex Algorithms for implementation
● Dangerous concurrency and synchronization bugs
● Complex Debugging : Bugs, Memory Leaks,
Deadlocks etc
● Performance Backfire : Sloppy design
● Code Portability
GlusterFS20
Programming Language Support : C
● Pthread
● Mutex locks
● Condition Variables
● Atomic Variables
● setjmp, sigsetjmp, longjmp, siglongjmp - performing a
nonlocal goto
GlusterFS21
Programming Language Support : C++
● Support as C
● Coroutines
● Boost Library
● C++17
GlusterFS22
Programming Language Support : GO
● Goroutines
● Go Channels
GlusterFS23
References
● http://tutorials.jenkov.com/java-concurrency/concurrency-vs
● https://en.wikipedia.org/wiki/Concurrent_computing
● http://blog.golang.org/concurrency-is-not-parallelism
● http://stackoverflow.com/questions/1050222/concurrency-v
GlusterFS24
THANK YOU

More Related Content

PDF
Powerlang: a Vehicle for Lively Implementing Programming Languages
PDF
PostgreSQL and Compressed Documents (pgconf.ru 2018)
ODP
Bridging Ousterhout's Dichotomy
PDF
Powerlang: a Vehicle for Lively Implementing Programming Languages
PDF
Your interactive computing
ODP
Rust Primer
PPTX
Rust programming-language
PDF
IPv4aaS tutorial and hands-on
Powerlang: a Vehicle for Lively Implementing Programming Languages
PostgreSQL and Compressed Documents (pgconf.ru 2018)
Bridging Ousterhout's Dichotomy
Powerlang: a Vehicle for Lively Implementing Programming Languages
Your interactive computing
Rust Primer
Rust programming-language
IPv4aaS tutorial and hands-on

What's hot (14)

PDF
Rust's Journey to Async/await
PPTX
Eugene Khvedchenia - Image processing using FPGAs
PDF
Using VIM for PHP/Symfony development
PDF
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
PPTX
Introducing #liveDB
PDF
Maxim Kamensky - Applying image matching algorithms to video recognition and ...
PDF
Continuous Performance Regression Testing with JfrUnit
PDF
How to rewrite the OS using C by strong type
PDF
Speeding up Page Load Times by Using Starling
PPTX
Fedor Polyakov - Optimizing computer vision problems on mobile platforms
PPTX
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
PDF
Introduction to protocol buffer
PDF
Current status of PSR - Phpblt1
PDF
Garbage collector и управление памятью в Go
Rust's Journey to Async/await
Eugene Khvedchenia - Image processing using FPGAs
Using VIM for PHP/Symfony development
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
Introducing #liveDB
Maxim Kamensky - Applying image matching algorithms to video recognition and ...
Continuous Performance Regression Testing with JfrUnit
How to rewrite the OS using C by strong type
Speeding up Page Load Times by Using Starling
Fedor Polyakov - Optimizing computer vision problems on mobile platforms
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
Introduction to protocol buffer
Current status of PSR - Phpblt1
Garbage collector и управление памятью в Go
Ad

Similar to Concurrent vsparallel (20)

PPTX
Go fundamentals
PDF
DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...
PDF
Fault tolerance - look, it's simple!
ODP
Sdc challenges-2012
PDF
Sdc 2012-challenges
PPTX
Efficient Buffer Management
PDF
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PPTX
Go programming language
PDF
High-Performance Networking Using eBPF, XDP, and io_uring
PDF
Threads and processes
PDF
Introduction to functional programming
PDF
Preparing Fusion codes for Perlmutter - CGYRO
PDF
Performance optimization techniques for Java code
ODP
Concurrent Programming with Ruby and Tuple Spaces
PDF
Introduction to Idem for Microsoft Azure
PDF
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
PPTX
Block Storage Updates - Juno Edition
PPTX
Gopher in performance_tales_ms_go_cracow
ODP
Mastering InnoDB Diagnostics
ODP
Harrison fisk masteringinnodb-diagnostics
Go fundamentals
DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...
Fault tolerance - look, it's simple!
Sdc challenges-2012
Sdc 2012-challenges
Efficient Buffer Management
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
Go programming language
High-Performance Networking Using eBPF, XDP, and io_uring
Threads and processes
Introduction to functional programming
Preparing Fusion codes for Perlmutter - CGYRO
Performance optimization techniques for Java code
Concurrent Programming with Ruby and Tuple Spaces
Introduction to Idem for Microsoft Azure
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Block Storage Updates - Juno Edition
Gopher in performance_tales_ms_go_cracow
Mastering InnoDB Diagnostics
Harrison fisk masteringinnodb-diagnostics
Ad

Recently uploaded (20)

PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Well-logging-methods_new................
PDF
R24 SURVEYING LAB MANUAL for civil enggi
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
composite construction of structures.pdf
PPTX
Geodesy 1.pptx...............................................
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
web development for engineering and engineering
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
PPT on Performance Review to get promotions
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPT
Project quality management in manufacturing
PPTX
additive manufacturing of ss316l using mig welding
UNIT 4 Total Quality Management .pptx
Internet of Things (IOT) - A guide to understanding
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Model Code of Practice - Construction Work - 21102022 .pdf
Well-logging-methods_new................
R24 SURVEYING LAB MANUAL for civil enggi
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
composite construction of structures.pdf
Geodesy 1.pptx...............................................
Foundation to blockchain - A guide to Blockchain Tech
web development for engineering and engineering
Lecture Notes Electrical Wiring System Components
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPT on Performance Review to get promotions
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Project quality management in manufacturing
additive manufacturing of ss316l using mig welding

Concurrent vsparallel