
Explore posix timers on Linux, learn to create, update, delete, restart, resume, and reschedule timers, and implement periodic and exponential backoff timers while building a custom timer library.
Explore Linux timers implementation and design in C, and join the Telegram group to discuss concepts, share code, and collaborate on timer mechanisms.
Explore the relevance of timers across networking and security contexts, and learn to implement Linux and POSIX timer APIs to build custom, controllable timers.
Explore three timer types and how Linux APIs implement one-shot, periodic, and exponential backoff timeouts to build a versatile timer library.
Learn POSIX timer APIs by creating, starting and stopping, querying remaining time, and deleting timer objects, then build a custom timer library while clarifying start, alarm, fire, and expire.
Explains how the operating system implements timers by creating a new thread and invoking a timer callback after expiration. Describes one-shot, periodic, and exponential backoff timers and resource cleanup.
explains creating linux timers in c with a three-argument api, detailing timer types, a sigev notifier function, and arming timers using itimerspec and timer_settime.
Learn to implement and demonstrate Linux timers in C, including creating timers, configuring callback functions, starting countdowns, and converting one-shot timers to periodic with an interval.
Design a timer library as a wrapper over the POSIX timer in C, enabling pause, resume, delete, restart, and reschedule, while hiding complex data structures behind a simple API.
Define a wrapper timer data structure including a POSIX timer, user argument, expiration intervals, a callback, a threshold, and tracking of remaining time, invocation count, and exponential backoff state.
Explore the Linux timer implementation in C. Understand the timer state machine from creation to running, pause, resume, cancel, and delete, with transitions and lifecycle management.
Initialize a wrapped timer with a six-argument constructor to set attributes. Store the callback, expiration times, user data, and exponential backoff flag, then create the posix timer.
Explore implementing Linux timers in C, focusing on the timer API, expiration time with interval attributes, and a callback function that invokes a user defined callback with a typed argument.
Implement start timer APIs in C for Linux timers, using a reset timer wrapper to start or stop the running timer based on the time data structure's interval and value.
Demonstrate testing a wrapper timer in C with setup time API and a user callback fired every thousand milliseconds, and convert test into a menu driven program with timer options.
Implement a remaining time API in C that returns remaining milliseconds via the Linux timer API's two-argument interface; convert seconds and nanoseconds and declare the prototype in the header.
Pause the running timer in a Linux timer design by saving the remaining time to the timer time remaining attribute and updating its state for a precise resume.
Learn how to resume a timer, repopulate time remaining and intervals, handle the timer callback after the first expiry post-resume, and trigger subsequent invocations when a secondary timer is set.
Implement a timer-based routing table project in C that adds, updates, and deletes entries, with 30-second timers expiring routing table entries from a linked-list data structure and a practical demo.
Implement per-entry timers in a Linux routing table by adding expiration time, a timer, extending the API with a deletion callback, and implementing a timer callback to remove expired entries.
Analyze per-entry routing table timers, uncovering concurrency risks and scalability limits; learn wheel timers that manage millions with a single thread.
Explore how a wheel timer maps seconds to slots, with per-slot linked lists of events and function pointers triggering on each tick, while the rotation value tracks completed cycles.
Design part 2 explains how to implement a wheel timer in C, scheduling events as function pointers in slots with small r values and triggering after rotations.
Explore the real timer design using a wheel timer with slots, ticks, and rotation, detailing initialization, threading, and event registration.
Demonstrate building a C real timer application that schedules and prints a string every five seconds using a real timer, start timer, wrapper function, and event registration, with multi-threading.
Implement your own real timer from scratch in C, using the provided code as reference, verify it by sending periodic packets via TCB and UDP sockets, and publish on GitHub.
Practice timer-based synchronization by implementing timers and event scheduling for a distributed database across two processes. Learn prerequisites in UDP socket programming or IPC, using 127.0.0.1 with distinct ports.
Implement a routing table as a linked list, keyed by destination subnet and mask, with gateway and interface fields, and provide a menu to add, delete, update, and view entries.
Implement a client-side routing table that queries the server via UDP for routing entries, uses five-second waits with up to three retries, and refreshes or expires entries after 60 seconds.
Display the client-side routing table with expiry times and uptime, using a C time manipulation approach, and optionally extend the project to support multi-client servers and full routing-table dumps.
Discover hierarchical real-time timers and how a hierarchy of wheel timers scales, using seconds, minutes, and hours with 60, 60, and 12 slots to schedule future events.
Learn to schedule a one-time event with a hierarchical wheel timer: place it in minutes wheel timer slot 51, then downgrade to the seconds timer to fire after 3 seconds.
Examine scheduling event E2 in a hierarchical wheel timer, placing it in the hours, minutes, and seconds slots to fire after 3 hours, 45 minutes, and 3 seconds.
Explore scheduling events in hierarchical wheel timer systems, placing E3 after three hours, 45 minutes, and three seconds, then re-inserting it into higher level timers.
Extend a single wheel timer into a hierarchical wheel timer with at least three levels, enabling scalable scheduling of future events across minutes, seconds, and hours.
Learn to write makefiles to automate compiling, linking, and installing large C projects on Unix/Linux. Manage static and dynamic libraries and dependencies from source and header files.
Explore dependency trees with a makefile analogy, comparing the final executable to a meal and components to subcomponents, showing bottom-up builds and upward change propagation.
Create a makefile to build an executable and a static library from source files in common_math, complex_math, and trademarks directories, detailing object files and dependencies.
Write makefile rules with a target, dependencies, and recipes to convert source files into object files, assemble static libraries, and link executables using proper include and library flags.
Learn how this makefile defines the final executable ICSI, its object files and a static library, and how make uses depth-first post-order execution.
Explore Linux system programming and multi-threading with project-based learning, including socket programming and debugging techniques on Linux, to strengthen your resume and boost job opportunities.
O Ghosh !! I just cannot shout-out more how important TIMERS are in almost all applications or projects. Timers are used to schedule events to be triggered or fired in future. How have you been doing this till now ?
Timers Use case Scenarios :
1. Firing One time future Event : Delete something after 100 seconds
2. Firing Repeated Regular future Events : Send packet to machine X after every 5 seconds
3. Periodic Waits : Try something 5 times at an interval of 3 seconds
How would you design a timer ? PET Question for interview. So better prepare for it.
About this Course This is short project based course, yet important course to cover Data Structures and Algorithms involved in designing efficient timers. We shall be using C as a programming language, but you are free to use your favorite programming language. This course is Programming language agnostic.
Course Pre-requisite
If you can code in any programming language, that suffice.
You should familiar with basic data structures such as linked list and function pointers.
Basics of Multi-threading
Also, Please just do not sit and watch my codes. Write your own codes, even if it is same as mine !
No Third Party libraries
Whatever logic you implement, you need to implement it from scratch. This course do not suggest taking help of any third party library to get the jobs done. Use of external libraries completely defeats the purpose of the course. However, it is recommended to use third party libraries for commonly used data structures such as linked lists/Trees/Queues etc which saves a lot of time implementing these data structures.
Warning : This course has auto system-generated subtitles which may not be perfect. Please disable subtitles as per your convenience.