Notes - MIECT
Computação Distribuída
Notes - MIECT
Computação Distribuída
  • Computação Distribuída
  • Introduction / Architecture
    • Distributed Systems
    • Architecture
    • Middleware Organizations
    • Processes
    • Threads
    • Virtualization
    • Clients
    • Servers
    • Migration
  • Communications
    • OSI Model
    • Middleware Layer
    • Types of Communication
    • Remote Call Procedure (RPC)
    • Sockets
    • Application-level Multicasting
  • Naming
    • Names
    • Addresses
    • Identifiers
    • Naming Systems
      • Flat Naming
      • Structured Naming
    • Internet Domain Name System (DNS)
    • Attribute-based naming - LDAP
  • Coordination
    • Clocks
      • Synchronizing without UTC
    • Reference Broadcast Synchronization – RBS
    • Happened-Before Relation
      • Logical Clocks
      • Vector Clocks
    • Mutual Exclusion Algorithms
    • Election Algorithms
    • Distributed Events Correspondance
  • Consistency & Replication
    • Replication
    • Performance and Scalability
    • Client-centric models
    • Replicates
    • Unicasting vs. Multicasting
    • Continuous Consistency
    • Protocols
  • Flaw Tolerance
    • Dependability
    • Terminology
    • Confidence vs. Security
    • Halting failures
    • Redundancy to mask failures
    • Consensus
      • Realistic
      • Consensus in arbitrary failures
      • Achieving failure tolerance
      • Distributed consensus
    • Failure Detection
    • Reliable RPCs
    • Distributed commit protocols
  • Python asyncio & Friends
    • Async
    • Sync vs. Async
    • Tools
  • Flask
    • Introduction
    • Python Requests
  • Containers
    • VM's vs Containers
    • OS Support
    • Building a container
    • Tools
    • Portability
    • Docker
      • Container
  • Map Reduce
    • Map Recude
    • Hadoop
    • Software Architecture
    • Task Scheduling
    • Comparison With Traditional Models
  • Cloud Computing
    • Cloud Computing
    • IaaS – Infrastructure as a Service
    • PaaS – Platform as a Service
    • SaaS – Software as a Service
    • Business Models
Powered by GitBook
On this page
  • What is it ?
  • How does it work in Python?
  • Asyncio:
  • How to support Async?
  • Asynchronous tasks programming
  1. Python asyncio & Friends

Async

PreviousDistributed commit protocolsNextSync vs. Async

Last updated 2 years ago

What is it ?

Is a concurrent programming pattern.

How does it work in Python?

The SO manages all the multi-tasking work.

In CPython, the GIL (Global Interpreter Lock) stops concurrency by using multiple cores - the interpreter is locked to one core.

Asyncio:

  • Without SO intervention.

  • One process, one thread.

How to support Async?

Async functions need the power to suppress and resume.

The power to suppress a function for a time period when it should be suspended and only resume it when the wait has ended.

Implementing suppression/resume in Python requires:

  • Callback's.

  • Generators.

  • Async/Await (Python 3.5+).

Asynchronous tasks programming

Async frameworks need a scheduler, usually called an "event loop".

The loop takes care of all tasks in execution.

When a function is suppressed, it returns power to the loop which is looking for another function that succeeds it.

All of this is called "cooperative multi-tasking".