arrow
arrow
arrow
Which of the following statement is correct for Pthreads?
Question

Which of the following statement is correct for Pthreads?

A.

It refers to POSIX standard (IEEE 1002.1c).

B.

This standard defines API for thread creation only.

C.

This is a specification only for thread behavior and not its implementation.

D.

Operating systems like Solaris, Linux & Mac OS X, except Tru64 UNIX, implement Pthreads.

Correct option is C


Pthreads (POSIX threads) is a standardized API for thread management. The question is asking for the correct statement related to Pthreads.
Let's analyze each statement in detail:
1. It refers to POSIX standard (IEEE 1002.1c): This statement is incorrect because the correct POSIX standard for Pthreads is IEEE 1003.1c (not 1002.1c). So, this option is incorrect due to the wrong standard number. POSIX (Portable Operating System Interface) is a set of standards specified for maintaining compatibility between operating systems.
2. This standard defines API for thread creation only: This statement is incorrect. The Pthreads standard does more than just define APIs for thread creation. It also includes APIs for thread synchronization, thread management, and mutexes, among other thread-related operations. So, it's not limited to thread creation.
3. This is a specification only for thread behavior and not its implementation: This statement is correct. The Pthreads standard defines how threads should behave and provides a specification for thread operations, but it does not specify how threads should be implemented. The actual implementation of thread management is left to the system or platform, allowing flexibility across different operating systems.
4. Operating systems like Solaris, Linux & Mac OS X, except Tru64 UNIX, implement Pthreads: This statement is incorrect. While it is true that many operating systems like Solaris, Linux, and Mac OS X implement Pthreads, the statement is not universally true. The exception (Tru64 UNIX) might be one case, but this is not a comprehensive or correct description of Pthreads' availability or support across all systems.
The correct answer is Option (c): This is a specification only for thread behavior and not its implementation.
Information Booster:
1. POSIX Threads (Pthreads): The Pthreads API is defined by the POSIX standard and is used widely in Unix-like operating systems for multi-threading. It allows for thread creation, synchronization, and management.
2. Thread Behavior vs. Implementation: While the standard defines how threads should operate and behave (such as how they should be created and synchronized), the implementation is left to the operating system or runtime library.
Additional Knowledge:
· Thread Synchronization: Pthreads includes functions for mutexes (mutual exclusion), semaphores, and condition variables, which are essential for thread synchronization and avoiding race conditions in multi-threaded applications.
· Platform Independence: The Pthreads API is designed to work across multiple platforms, but the implementation details (like how threads are managed at a low level) are dependent on the underlying operating system.
· IEEE 1003.1c (POSIX): The Pthreads standard is part of the POSIX 1003.1c standard, which defines thread management functions like creating, synchronizing, and terminating threads.

Free Tests

Free
Must Attempt

Basics of Education: Pedagogy, Andragogy, and Hutagogy

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon12 Mins
languageIcon English
Free
Must Attempt

UGC NET Paper 1 Mock Test 1

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt

Basics of Education: Pedagogy, Andragogy, and Hutagogy

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon12 Mins
languageIcon English
test-prime-package

Access ‘UGC NET Computer Science’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
354k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow