Os and networking Lab programs

June 3, 2010

Threads

Filed under: Operating Systems,Theory needed for implementing OS related problems — osandnetworkingcslab @ 5:40 pm

  • A thread of execution results from a fork of a computer program into two or more concurrently running tasks
  • The Linux kernel schedules threads asynchronously
  • A thread exists within a process.
  • Threads are a finer-grained unit of execution than processes. When you invoke a program, Linux creates a new process and in that process creates a single thread, which runs the program sequentially.
  • Thread can create additional threads; all these threads run the same program in the same process, but each thread may be executing a different part of the program at any given time.
  • All threads within a process share the same address space.
  • The creating and the created thread share the same memory space, file descriptors, and other system resources as the original. If one thread changes the value of a variable, for instance, the other thread subsequently will see the modified value.Similarly, if one thread closes a file descriptor, other threads may not read from or write to that file descriptor

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.