System Administration Guide: Resource Management and Network Services

How to Set the Maximum Number of LWPs for Each Task in a Project

Type this entry in the /etc/project database to set the maximum number of LWPs in each task in project x-files to 3.


x-files:100::root::task.max-lwps=(privileged,3,deny)

When superuser creates a new task in project x-files by joining it with newtask, superuser will not be able to create more than three LWPs while running in this task. This is shown in the following annotated sample session.


# newtask -p x-files csh

# prctl -n task.max-lwps $$
688: csh
task.max-lwps
                            3 privileged deny
                   2147483647 system     deny
# id -p
uid=0(root) gid=1(other) projid=100(x-files)

# ps -o project,taskid -p $$
 PROJECT TASKID
 x-files   236

# csh        /* creates second LWP */

# csh        /* creates third LWP */

# csh        /* cannot create more LWPs */
Vfork failed

#