A thread library provides the programmer with an API for creating and
managing threads. There are two primary ways of implementing a thread
library. The first approach is to provide a library entirely in user space with no
kernel support. All code and data structures for the library exist in user space.
This means that invoking a function in the library results in a local function
call in user space and not a system call.
The second approach is to implement a kernel-level library supported
directly by the operating system. In this case, code and data structures for
the library exist in kernel space. Invoking a function in the API for the library
typically results in a system call to the kernel.
Three main thread libraries are in use today: POSIX Pthreads,Windows, and
Java. Pthreads, the threads extension of the POSIX standard, may be provided
as either a user-level or a kernel-level library. The Windows thread library
is a kernel-level library available on Windows systems. The Java thread API
allows threads to be created andmanaged directly in Java programs. However,
because in most instances the JVM is running on top of a host operating system,
the Java thread API is generally implemented using a thread library available
on the host system. This means that on Windows systems, Java threads are
typically implemented using theWindows API; UNIX and Linux systems often
use Pthreads.
A thread library provides the programmer with an API for creating andmanaging threads. There are two primary ways of implementing a threadlibrary. The first approach is to provide a library entirely in user space with nokernel support. All code and data structures for the library exist in user space.This means that invoking a function in the library results in a local functioncall in user space and not a system call.The second approach is to implement a kernel-level library supporteddirectly by the operating system. In this case, code and data structures forthe library exist in kernel space. Invoking a function in the API for the librarytypically results in a system call to the kernel.Three main thread libraries are in use today: POSIX Pthreads,Windows, andJava. Pthreads, the threads extension of the POSIX standard, may be providedas either a user-level or a kernel-level library. The Windows thread libraryis a kernel-level library available on Windows systems. The Java thread APIallows threads to be created andmanaged directly in Java programs. However,because in most instances the JVM is running on top of a host operating system,the Java thread API is generally implemented using a thread library availableon the host system. This means that on Windows systems, Java threads aretypically implemented using theWindows API; UNIX and Linux systems oftenuse Pthreads.
การแปล กรุณารอสักครู่..
หัวข้อห้องสมุดมี API สำหรับการสร้างและโปรแกรมเมอร์กับ
การจัดการกระทู้ มีสองวิธีหลักของการใช้ด้าย
ห้องสมุด วิธีแรก เพื่อให้ห้องสมุดทั้งหมดในพื้นที่ผู้ใช้ไม่มี
สนับสนุนเคอร์เนล รหัสทั้งหมดและโครงสร้างข้อมูลสำหรับห้องสมุดที่มีอยู่ในพื้นที่ผู้ใช้ .
ซึ่งหมายความว่าเรียกฟังก์ชันในไลบรารีฟังก์ชันผลลัพธ์ใน
ท้องถิ่นโทรในพื้นที่ผู้ใช้และไม่เป็นระบบ โทร .
วิธีที่สองคือใช้เคอร์เนลระดับห้องสมุดสนับสนุน
โดยตรง โดยระบบปฏิบัติการ ในกรณีนี้ , รหัสและโครงสร้างข้อมูลสำหรับ
ห้องสมุดที่มีอยู่ในโปรแกรมอวกาศ เรียกฟังก์ชันใน API สำหรับห้องสมุด
มักจะผลในระบบโทรศัพท์ให้เคอร์เนล .
3 ห้องสมุดหัวข้อหลักในการใช้งานในวันนี้ : POSIX pthreads , Windows , และ
Javaหัวข้อ pthreads , ส่วนขยายของมาตรฐาน POSIX , อาจจะให้
เป็นทั้งผู้ใช้ระดับหรือเคอร์เนลระดับห้องสมุด หน้าต่างหัวข้อห้องสมุด
เป็น kernel ระดับห้องสมุดที่มีอยู่ในระบบ Windows Java API ให้ด้าย
กระทู้ที่ถูกสร้างขึ้น andmanaged โดยตรงในโปรแกรม Java อย่างไรก็ตาม
เพราะในกรณีส่วนใหญ่ JVM ทำงานบนโฮสต์ระบบปฏิบัติการ
Java API ที่ใช้โดยทั่วไปคือ ใช้ด้ายด้ายห้องสมุดใช้ได้
ในระบบโฮสต์ ซึ่งหมายความว่าในระบบ Windows , กระทู้จาวาคือใช้ thewindows
โดยปกติใช้ API ของระบบ Unix และ Linux ; มักใช้ pthreads
.
การแปล กรุณารอสักครู่..