Utilize POSIX Threads for Concurrency
Refactor a slow, single-threaded C file downloader that fetches files sequentially into a multi-threaded program using POSIX Threads (pthreads) to achieve concurrent downloads.
Focused, hands-on problems for sharpening your DevOps and server-side skills. Some teach specific concepts while others mirror real-world scenarios. Every challenge includes hints, feedback, and automated solution checks.
Refactor a slow, single-threaded C file downloader that fetches files sequentially into a multi-threaded program using POSIX Threads (pthreads) to achieve concurrent downloads.
Write a C program that calls fork() to clone a process and execve() to execute a command, then print and retrieve the child process PID.
Compile a small C loop with -O2 -S, inspect the generated assembly, report how many add instructions gcc produced and see how much it has optimized the equasion.
Run gcc -E on a small C program and find the exact line where the preprocessor expanded a macro into a printf call.
Produce a valid ELF binary that runs and exits cleanly, but does not define a main() function.