SUN Microsystem Interview

5.In matrix manupilation, Shall we use process and thread ?

Thread

Well,consider the two matrices mat1 and mat2 are read-only; the result matrix is written to, but each of the threads only writes to a specific part of the array which is used to store the resulting column which that thread is working on. There is never any conflict.



6.What is difference between task and process?

Task: A single execution program.
Process: A process (in somewhat simplistic terms) is one instance of a running program on a system.

7. What is difference between task and thread?
Thread:
A single thread also has a beginning, a sequence, and an end. At any given time during the runtime of the thread, there is a single point of execution.

8. what is internal implementation of fork() system call?

DESCRIPTION :


The fork() function shall create a new process. The new process (child process) shall be an exact copy of
the calling process (parent process) except as detailed below:

The child process shall have a unique process ID.

The child process ID also shall not match any active process group ID.

The child process shall have a different parent process ID, which shall be the process ID of the calling
process.

RETURN VALUE


Upon successful completion, fork() shall return 0 to the child process and shall return the process ID
of the child process to the parent process. Both processes shall continue to execute from the fork()
function. Otherwise, -1 shall be returned to the parent process, no child process shall be created,
and errno shall be set to indicate the error.

ERRORS


The fork() function shall fail if:


The system lacked the necessary resources to create another process, or the system-imposed limit on the
total number of processes under execution system-wide or by a single user {CHILD_MAX} would be exceeded.


The fork() function may fail if:


Insufficient storage space is available.



9. what is internal implementation of gdb debugger ?

A general defn:

GDB is a debugger which is part of the Free Software Foundation's GNU operating system. Its original author is Richard M. Stallman (affectionately known as "RMS")

GDB can be used to debug C, C++, Objective-C, Fortran, Java and assembly programs. There is partial support for Modula-2 and Pascal. It'll run on almost any architecture you can think of that supports Unix, so learning GDB on your home PC will give you the power to debug code just about anywhere Unix can
run!

No comments:

Ramadan - What is it?

  Ramadan is one of the most important and holy months in the Islamic calendar. It is a time of fasting, prayer, and spiritual reflection fo...