This chapter initially delved into the motivation behind per-process resource limits and why we require them. We also explained the granularity and the types of resource limits, distinguishing between soft and hard limits. Then we looked at how a user (or system administrator) can query and set the per-process resource limits using appropriate CLI frontends (ulimit(1), prlimit(1)).
Finally, we explored the programming interfaces (APIs)—practically speaking, the prlimit(2) system call—in detail. Two detailed code examples, querying the limits and setting a limit on CPU usage, rounded out the discussion.
In the next chapter, we will learn about the crucial, dynamic memory-management APIs and their correct usage. We'll go well beyond the basics of using the typical malloc() API, delving into a few subtle and important inner details.