- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the maximum number of threads per process in Linux?
There are multiple ways with which we can check the maximum number of threads that Linux has allocated to a particular process.
We can also increase the default value set by linux with the help of the command shown below −
echo 123456789 > /proc/sys/kernel/threads-max
where 123456789 = Number of threads
It is also known that Linux doesn’t have a separate threads per limit and it basically implemented the maximum number of threads per process indirectly.
number of threads = total virtual memory / (stack size*1024*1024)
So the threads per process can be increased by decreasing the stack size or increasing the virtual memory.
We can also increase the virtual memory on our machine with the help of the command shown below −
ulimit -s newvalue
In the above command, you should replace the new value with the value that you want to put as the limit.
The stack size can be increased with the help of the command shown below −
ulimit -v newvalue
In the above command you should replace the new value with the value that you want to put as the limit.
Kickstart Your Career
Get certified by completing the courseGet Started