Symantec Interview Question for Associates


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
4
of 4 vote

There is no limitation of the number of threads per process.however there is a limitation of the total number of threads created. If your OS is linux(or like), you can see the number:
cat /proc/sys/kernel/threads-max

- notbad September 18, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
3
of 3 vote

This is OS-specific. There's no conceptual reason there has to be any particular upper bound.

- eugene.yarovoi September 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

There is no particular limit for no of threads inside a process till you have available memory.If you have memory then you can create as many threads you want.Take the example off a web server it can create as many threads it wants according to the number of users it is serving. So as per my view it depends on the memory limitations.

- m2anuj December 22, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Number of threads in a process is dependent on the virtual memory available in the system and the stack size. The approximate number of threads possible in a process can be calculated by using following formula:
Virtual memory = Physical RAM + swap memory
Number of threads = (virtual memory)/stack-size for a process.
The stack size that a process can have can be obtained using following command:
ulimit -s

The above theory comes from the fact that every thread in the process shares process resources except they have their own set of registers and stack. They share the process address space, which includes code segment, data segment, process heap. In case stack size is increased then total number of thread which can exist simultaneously in a process will decrease and if we try to create more threads then the thread creation api (like pthread_create) returns error (EAGAIN ) to indicate that no more resource (memory to allocate stack) is available in the system.

- Jitendra Singh September 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

There is no limitation of the no.of threads in a process.It is depends on memory limitation

- Anonymous September 26, 2013 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More