Luồng (điện toán)

Một tiến trình với hai luồng thực thi, chạy trên bộ xử lý

Trong khoa học máy tính, luồng (tiếng Anh: thread) là một chuỗi các lệnh được lập trình nhỏ nhất để có thể được quản lý độc lập bởi một bộ định thời (scheduler), thường là một phần của hệ điều hành.[1] Việc hiện thực các luồng và tiến trình (process) khác nhau giữa các hệ điều hành, nhưng trong hầu hết các trường hợp, luồng là một thành phần của tiến trình. Đa luồng có thể tồn tại trong cùng một tiến trình, thực thi đồng thời và chia sẻ tài nguyên như bộ nhớ, trong khi những tiến trình khác nhau thì không chia sẻ các tài nguyên này. Cụ thể, các luồng trong một tiến trình chia sẻ mã thực thi và giá trị của các biến được phân bổ độngbiến toàn cục không phải cục bộ của luồng tại bất kì thời điểm nào.

Hệ thống đơn với đa bộ xử lý

Xem thêm

  • iconCổng thông tin Lập trình máy tính
  • Clone (Linux system call)
  • Communicating sequential processes
  • Computer multitasking
  • Multi-core (computing)
  • Multithreading (computer hardware)
  • Non-blocking algorithm
  • Priority inversion
  • Protothreads
  • Simultaneous multithreading
  • Thread pool pattern
  • Thread safety
  • Win32 Thread Information Block

Ghi chú

Tham khảo

  1. ^ Lamport, Leslie (tháng 9 năm 1979). “How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs” (PDF). IEEE Transactions on Computers. C-28 (9): 690–691. doi:10.1109/tc.1979.1675439.

Đọc thêm

  • David R. Butenhof: Programming with POSIX Threads, Addison-Wesley, ISBN 0-201-63392-2
  • Bradford Nichols, Dick Buttlar, Jacqueline Proulx Farell: Pthreads Programming, O'Reilly & Associates, ISBN 1-56592-115-1
  • Charles J. Northrup: Programming with UNIX Threads, John Wiley & Sons, ISBN 0-471-13751-0
  • Mark Walmsley: Multi-Threaded Programming in C++, Springer, ISBN 1-85233-146-1
  • Paul Hyde: Java Thread Programming, Sams, ISBN 0-672-31585-8
  • Bill Lewis: Threads Primer: A Guide to Multithreaded Programming, Prentice Hall, ISBN 0-13-443698-9
  • Steve Kleiman, Devang Shah, Bart Smaalders: Programming With Threads, SunSoft Press, ISBN 0-13-172389-8
  • Pat Villani: Advanced WIN32 Programming: Files, Threads, and Process Synchronization, Harpercollins Publishers, ISBN 0-87930-563-0
  • Jim Beveridge, Robert Wiener: Multithreading Applications in Win32, Addison-Wesley, ISBN 0-201-44234-5
  • Thuan Q. Pham, Pankaj K. Garg: Multithreaded Programming with Windows NT, Prentice Hall, ISBN 0-13-120643-5
  • Len Dorfman, Marc J. Neuberger: Effective Multithreading in OS/2, McGraw-Hill Osborne Media, ISBN 0-07-017841-0
  • Alan Burns, Andy Wellings: Concurrency in ADA, Cambridge University Press, ISBN 0-521-62911-X
  • Uresh Vahalia: Unix Internals: the New Frontiers, Prentice Hall, ISBN 0-13-101908-2
  • Alan L. Dennis: .Net Multithreading , Manning Publications Company, ISBN 1-930110-54-5
  • Tobin Titus, Fabio Claudio Ferracchiati, Srinivasa Sivakumar, Tejaswi Redkar, Sandra Gopikrishna: C# Threading Handbook, Peer Information Inc, ISBN 1-86100-829-5
  • Tobin Titus, Fabio Claudio Ferracchiati, Srinivasa Sivakumar, Tejaswi Redkar, Sandra Gopikrishna: Visual Basic.Net Threading Handbook, Wrox Press Inc, ISBN 1-86100-713-2

Liên kết ngoài


  • What makes multi-threaded programming hard?
  • Article "Query by Slice, Parallel Execute, and Join: A Thread Pool Pattern in Java" by Binildas C. A.
  • Article "The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software" by Herb Sutter
  • Article "The Problem with Threads" by Edward Lee
  • ConTest – A Tool for Testing Multithreaded Java Applications by IBM
  • Debugging and Optimizing Multithreaded OpenMP Programs
  • Multithreading trên DMOZ
  • Multithreading in the Solaris Operating Environment
  • POSIX threads explained by Daniel Robbins
  • The C10K problem
  • “Operating System | Difference between multitasking, multithreading and multiprocessing”. GeeksforGeeks. ngày 16 tháng 1 năm 2018.

Bản mẫu:Điện toán song song

  • x
  • t
  • s
Chung
Hạt nhân
Các thành phần
Quản lý tiến trình
Các khái niệm
Thuật toán
lập kế hoạch
  • Máy tính đa tác vụ
  • Fixed-priority pre-emptive scheduling
  • Multilevel feedback queue
  • Preemption (computing)
  • Round-robin scheduling
  • Shortest job next
Quản lý bộ nhớ
bảo vệ tài nguyên
  • Bus error
  • General protection fault
  • Bảo vệ bộ nhớ
  • Phân trang
  • Protection ring
  • Segmentation fault
  • Bộ nhớ ảo
Truy cập lưu trữ
hệ thống tập tin
Danh sách
Khái niệm khác
Tiêu đề chuẩn Sửa dữ liệu tại Wikidata
  • BNF: cb133204714 (data)
  • GND: 4377482-9
  • LCCN: sh97002264