Skip to content

SundaramManickam/shell-programming-multi-process-concurrency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Note

The genid function uses an atomic mkdir lock to serialize access: each process safely reads, increments, and updates a counter file, ensuring sequential, zero-padded IDs. No external tools are required.

During testing, trying to spawn 5,000 processes at once initially caused system errors (fork: Resource temporarily unavailable). To address this, the test script (testid.sh) introduced throttling, allowing only 200 concurrent jobs at a time and using a small sleep (0.01s) delay to avoid overwhelming the system scheduler.

The final validation compares sorted outputs to an expected list of 5-digit IDs, checking for missing or duplicate entries.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages