1 / 20

Chapter 5: Threads (İş Parçacıkları)

Chapter 5: Threads (İş Parçacıkları). Overview (Genel Bakış) Multithreading Models (Çoklu Thread Modelleri) Threading Issues (Thread Sorunları) Pthreads (Pthreadler) Solaris 2 Threads (Solaris 2 Threadleri) Windows 2000 Threads (Windows 2000 Threadleri) Linux Threads (Linux Threadleri)

hua
Télécharger la présentation

Chapter 5: Threads (İş Parçacıkları)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 5: Threads(İş Parçacıkları) • Overview(Genel Bakış) • Multithreading Models(Çoklu Thread Modelleri) • Threading Issues(Thread Sorunları) • Pthreads(Pthreadler) • Solaris 2 Threads(Solaris 2 Threadleri) • Windows 2000 Threads(Windows 2000 Threadleri) • Linux Threads(Linux Threadleri) • Java Threads(Java Threadleri) Operating System Concepts

  2. Single and Multithreaded Processes(Tek ve Çoklu Thread Süreçleri) Operating System Concepts

  3. Benefits (Faydaları) • Responsiveness(Yanıt verme kabiliyeti) • Resource Sharing(Kaynak Paylaşımı) • Economy(Ekonomik) • Utilization of MP Architectures(MP Mimarilerinin kullanımı) Operating System Concepts

  4. User Threads(Kullanıcı Threadleri) • Thread management done by user-level threads library(Thread yönetimi kullanıcı-seviye threadleri kütüphanesi tarafından yapılır.) • Examples(Örnekler) - POSIX Pthreads(POSIX Pthreadleri) - Mach C-threads(Mach C-threadleri) - Solaris threads(Solaris threadleri) Operating System Concepts

  5. Kernel Threads(Çekirdek Thredleri) • Supported by the Kernel(Çekirdek tarafından desteklenir) • Examples(Örnekler) - Windows 95/98/NT/2000 - Solaris - Tru64 UNIX - BeOS - Linux Operating System Concepts

  6. Multithreading Models(Çoklu Thread Modelleri) • Many-to-One(Çoka Bir) • One-to-One(Bire Bir) • Many-to-Many(Çoka Çok) Operating System Concepts

  7. Many-to-One(Çoka Bir) • Many user-level threads mapped to single kernel thread.(Çok sayıda kullanıcı-seviye threadleri tek çekirdek thread’i ile eşlenir.) • Used on systems that do not support kernel threads.(Çekirdek threadlerini desteklemeyen sistemlerde kullanılır.) Operating System Concepts

  8. Many-to-One Model(Çoka Bir Modeli) Operating System Concepts

  9. One-to-One(Bire Bir) • Each user-level thread maps to kernel thread.(Her kullanıcı-seviye thread’i çekirdek thread’i ile eşlenir.) • Examples(Örnekler) - Windows 95/98/NT/2000 - OS/2 Operating System Concepts

  10. One-to-one Model (Bire Bir Modeli) Operating System Concepts

  11. Many-to-Many Model(Çoka Çok Modeli) • Allows many user level threads to be mapped to many kernel threads.(Çok sayıda kullanıcı-seviye threadlerinin, çok sayıda çekirdek threadleri ile eşleşmesini sağlar.) • Allows the operating system to create a sufficient number of kernel threads.(İşletim sisteminin yeterli sayıda çekirdek threadi oluşturmasını sağlar. ) • Solaris 2 • Windows NT/2000 with the ThreadFiber package(ThreadFiberpaketi ile Windows NT/2000) Operating System Concepts

  12. Many-to-Many Model (Çoka Çok Modeli) Operating System Concepts

  13. Threading Issues(Threading Sorunları) • Semantics of fork() and exec() system calls(fork() ve exec() sistem çağrılarının semantiği) • Thread cancellation(Thread iptal etme) • Signal handling(Sinyal işleme) • Thread pools(Thread havuzları) • Thread specific data(Thread özel verisi) Operating System Concepts

  14. Pthreads • a POSIX standard (IEEE 1003.1c) API for thread creation and synchronization.(Thread yaratma ve senkronizasyon için bir POSIX standartı(IEEE 1003.1c) vardır.) • API specifies behavior of the thread library, implementation is up to development of the library.(API thread kütüphanesinin davranışını belirtir, uygulama kütüphanenin gelişmesine bağlıdır.) • Common in UNIX operating systems.(Unix işletim sistemlerinde yaygın olarak kullanılır) Operating System Concepts

  15. Solaris 2 Threads(Solaris 2 Threadleri) Operating System Concepts

  16. Solaris Process(Solaris Süreci) Operating System Concepts

  17. Windows 2000 Threads(Windows 2000 Threadleri) • Implements the one-to-one mapping.(Bire Bir eşlemede uygulanır.) • Each thread contains(her thread şu özellikleri içerir) - a thread id(thread id’si) - register set(belirlenen kayıt) - separate user and kernel stacks(ayrı kullanıcı ve çekirdek yığınları ) - private data storage area(özel veri depolama alanı) Operating System Concepts

  18. Linux Threads(Linux Threadleri) • Linux refers to them as tasks rather than threads.(Linux onları threadler yerine görevler olarak içerir) • Thread creation is done through clone() system call.(Thread oluşturulması clone() sistem çağrısı tarafından yapılır) • Clone() allows a child task to share the address space of the parent task (process)(Clone() çocuk görevin, ana görevin adres alanını paylaşmasını sağlar.) Operating System Concepts

  19. Java Threads(Java Threadleri) • Java threads may be created by:(Java threadleri aşağıdakiler tarafından oluşturulabilir:) • Extending Thread class(Thread sınıfına uzanma) • Implementing the Runnable interface(Çalıştırılabilir ara yüzleri yürütme) • Java threads are managed by the JVM.(Java threadleri JVM tarafından yönetilir.) Operating System Concepts

  20. Java Thread States(Java Thread Durumu) Operating System Concepts

More Related