C Language – Threads and Asynchronous I/O (C4)
Programming, C, C++
Practical course focusing on concurrency in C: from classical threads and mutexes to atomic operations, lock-free algorithms and shared memory handling. It explains the C memory model and common errors such as data races, inconsistencies and deadlocks, with mitigation strategies.
The course also covers event-driven design, non-blocking I/O and designing asynchronous APIs with callbacks and state machines to combine computation, communication and hardware handling efficiently. It is updated for C23, focused on embedded and Unix systems, and can be customized.
THIS TRAINING COURSE WILL HELP YOU:
- Understand the C memory model for multi-threaded applications
- Learn synchronization tools for shared-memory between threads
- Familiarize with ISO C11, POSIX-1.2024 and third-party libraries
- Practice event-driven programming using state machines
WHO SHOULD ATTEND?
- Experienced embedded systems and firmware developers
- Developers of operating systems, runtimes and frameworks
- Those interested in programming languages and runtimes
COURSE LOCATION AND AVAILABLE DATES
Private training
This course is not scheduled as a public course.
It is delivered exclusively as customised training. The content, duration, date, and delivery format are tailored to the customer's requirements and can also be provided in English.
Request customised training
Course content:
Hide details
-
Threads and processes
-
Threads as defined by C11
-
Processes on POSIX platforms
-
UNIX and the reluctance to use threads
-
Multithreaded memory model
-
Concurrency access issues
-
The happens-before relationship
-
Accessing shared data
-
Thread synchronization
-
Locks and critical sections (mutex)
-
Condition variables and signaling
-
Locking issues and deadlocks
-
Unix system facilities
-
Semaphores and message queues (POSIX, System V)
-
Shared memory (POSIX, System V)
-
Priority inheritance (pthreads)
-
Atomic operations
-
Lock-free synchronization
-
Memory ordering and hardware barriers
-
Passing results between threads (acquire/release)
-
Lock-free data structures
-
Applying atomics (CAS)
-
Algorithm properties (lock-free, wait-free)
-
The ABA problem
-
Callbacks
-
Function pointers and context (callbacks)
-
Recursive and deferred callbacks
-
Emulating lambdas from higher-level languages
-
State-based event processing
-
State machines with progress information
-
Cooperative interruption of activities
-
Emulating coroutines and cooperative tasks
-
Event loop
-
Event-driven software
-
Registration and chaining of callbacks
-
Waiting for groups of events (select)
-
Non-blocking I/O
-
OS support
-
Enables custom cooperative scheduler
-
Implementing an asynchronous scheduler
-
Principles of asynchronous I/O
-
Integrating scheduler and I/O
-
Computation versus communication
-
Interaction with multithreading
-
Asynchronous network communication
-
Communication over TCP/IP
-
HTTP server and client
-
Concurrency with other operations
-
Embedded and hardware communication
-
Serial line communication
-
Local communication channels
-
Interaction with the operating system
-
Bonus: Cross-platform libraries
-
libevent
-
libuv
-
libev
-
libcurl
-
Mongoose
-
Prerequisites:
-
Good knowledge of C programming.
-
Recommended previous course:
-
C Language — Practical Advanced Programming (C2)
-
Schedule:
-
3 days (9:00-17:00)
Training and learning environment
What does the environment for in-person IT courses look like?We hold training courses in our own classrooms equipped with modern computer equipment for each participant and a large projection screen. Each workstation is fitted with a powerful computer for seamless practical exercises, and the environment supports a calm, friendly atmosphere during training.
Do I need to bring my own laptop to the classroom IT course?Our training rooms are fully equipped, so you do not need to bring your own laptop. A modern computer with all necessary hardware and software is ready for you at your workstation.
Will you receive an official certificate after completing an IT course?Yes, upon successful completion of the training course, you will receive an official ICT Pro certificate confirming your participation and acquired technical skills. You can use it to verify your qualifications or add it to your professional profile.
Where can you find our training center in Brno?The premises of the ICT Pro training center are located on the 1st floor of the COMGUARD building at Sochorova 38 in Brno. Positioned on the border of Žabovřesky and Komín, the location is easily accessible by both car and public transport.
Where can you find our training center in Prague?The premises of the ICT Pro training center are located on the 1st floor of the Opatov Park building at Líbalova 1, Prague 11 – Chodov. The location provides a comfortable environment for your education with convenient access.
What facilities and refreshments are available to you during training breaks?Our training centers feature a fully equipped kitchenette for a comfortable break during your courses. The facilities include a coffee machine, microwave, kettle, and a wide selection of drinks and snacks.
What beverage refreshments are available during your course?A beverage station with a coffee machine, teas, syrups, and water is at your disposal throughout the entire training session. You can enjoy a coffee or another drink of your choice anytime during breaks.
What light refreshments are provided for you during the courses?During course breaks, participants can enjoy light sweet snacks, pastries, and fruit syrups to mix their own drinks. Fresh water dispenser and plates are also available for your convenience.
Should I bring my own snacks to ICT Pro training?There is no need to. A wide selection of savory snacks, sweet biscuits, and snack bars is available for you during breaks. Boost your energy for all-day focus right inside the training center premises.
Can you spend training breaks in the fresh air?Yes, an outdoor terrace is available at our training center. During breaks between learning sessions, you can relax in the fresh air in a pleasant green environment.
Where can you relax during course breaks?Our training center features a spacious outdoor terrace with seating options. During breaks between learning sessions, you can step outside to relax and recharge in the fresh air.