TAILIEUCHUNG - Visual Basic 2005 Design and Development - Chapter 21

Threading Hầu hết các máy tính ngày nay chỉ có một đơn vị xử lý trung tâm (CPU) thực hiện các lệnh. Điều đó có nghĩa là họ chỉ có thể làm một việc tại một thời điểm. CPU hiện đại là khá nhanh và có thể thực hiện nhiều triệu hoặc thậm chí hàng tỷ lệnh trong một giây. Hầu hết các ứng dụng không yêu cầu tốc độ nhiều, vì vậy máy tính phân chia thời gian của CPU để cho phép nhiều ứng dụng khác nhau thay phiên nhau chạy. CPU là quá nhanh mà chuyển đổi. | Threading Most computers today have only a single central processing unit CPU that executes instructions. That means they can only do one thing at a time. Modern CPUs are pretty fast and can execute many millions or even billions of instructions per second. Most applications don t require that much speed so the computer splits the CPU s time to let several different applications take turns running. The CPU is so fast that the switching takes place quickly enough to give the illusion that the computer is running more than one program at the same time. While the CPU can really only execute one instruction at a time it appears as if the Windows operating system is running a whole bunch of applications simultaneously. Each of the programs running on the computer is a separate process. Within a process you can create multiple threads of execution that can also run simultaneously. Every program has at least one process and thread but some create more. These threads are more closely related than the processes representing different applications but the idea is similar. Like processes the threads take turns running on the CPU so they give the illusion of running at the same time. Typically threads must communicate and work together to provide whatever application it is that they build as a group. To avoid confusion the operating system imposes strict rules on how threads can communicate safely. It s easier for different threads to communicate than it is for different processes because they are more closely related but there are still rules to follow. For example you could build a single application that monitors a stock quote Web site to track your favorite stocks. Separate threads could monitor each of several stocks and display their current prices on separate graphs within the same application. Each thread works separately but they all interact with the main program s form to display their data. This chapter describes some useful threading scenarios. It explains how to

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.