Hewlett Packard Interview Question for Software Engineer / Developers






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

Thread is light weight process while Process is a heavy weight one..
A Process has its own memory space, runtime enivorment and process ID.
A Thread run inside a Process and shares its resources with other threads.

- Abhi March 24, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Processes are independent execution units that contain their own state information, use their own address spaces, and only interact with each other via interprocess communication mechanisms.

A single process might contains multiple threads; all threads within a process share the same state and same memory space, and can communicate with each other directly, because they share the same variables.

- zdmytriv January 29, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

A thread is a stream of instructions in a process. A thread has its own stack , instruction pointer and address space but all these are in a virtual space which is process specific , so all thread can access each other's data. A thread thus can be termed as a light weight process.

A process is an instance of a computer program. Concurrency refers to a state where processor is involved in running several processes.

- Anonymous July 27, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Also threads and processes differs in the way scheduling, priority and the way errno for syscalls are handled.

Processes are separately scheduled by the kernel whereas Threads within the processes are scheduled by the thread manager.

Thread doesn't have priority whereas the processes have the priority.

when system calls return error the errno is set per process within the thread specific data.

Also there is seperate entity called "kernel threads" which runs in the context of the kernel and are separetly scheduled similar to processes. These can reference each threads individaully unlike processes and user threads. But this is a kernel component and needs to be kernel modules to use it.

- aravind January 31, 2014 | 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