Cấu hình cho Nhiều chủ đề hoạt động
trong một hệ điều hành đa luồng, bạn có thể thực hiện nhiều cuộc gọi đến một DLL hoặc thư viện chia sẻ cùng một lúc. Bạn có thể chọn các chủ đề để thực hiện các cuộc gọi thư viện từ phần chủ đề trên các tab chức năng của Call Library hộp thoại Function. Các tùy chọn chủ đề đang chạy trong thread UI và chạy ở bất kỳ chủ đề. Nếu bạn chọn Run trong UI thread, các chức năng Node Gọi Library chuyển từ các thread VI hiện đang thực hiện trong các chủ đề giao diện người dùng. Nếu bạn chọn Run trong bất cứ chủ đề, Chức năng Node Gọi Library tiếp tục trong các chủ đề hiện đang thực hiện. Theo mặc định, tất cả Chức năng Call Library nút chạy trong chủ đề giao diện người dùng. Trước khi bạn cấu hình một Call Thư viện Chức năng Node để chạy trong bất cứ chủ đề, hãy chắc chắn rằng nhiều chủ đề có thể gọi chức năng cùng một lúc. Trong một thư viện chia sẻ, mã có thể được coi là chủ đề an toàn khi: . Nó không lưu trữ bất kỳ dữ liệu toàn cầu, chẳng hạn như các biến toàn cầu, các tập tin trên đĩa, và như vậy nó không truy cập vào bất kỳ phần cứng. Nói cách khác, các mã không chứa chương trình đăng ký cấp. Nó không thực hiện bất kỳ cuộc gọi đến bất kỳ chức năng, thư viện chia sẻ, hoặc trình điều khiển mà không phải là chủ đề an toàn. Nó sử dụng semaphores hoặc mutexes để hạn chế quyền truy cập vào các nguồn tài nguyên toàn cầu. Nó được gọi là bởi chỉ có một phi reentrant VI. Lưu ý Tất cả các cuộc gọi đến các thư viện chia sẻ LabVIEW-xây dựng nên xác định Run trong chủ đề bất kì. Nếu bạn cấu hình các chức năng Node Gọi Thư viện bằng cách sử dụng thư viện chia sẻ LabVIEW-xây dựng và chỉ định Run trong UI thread, LabVIEW có thể treo và yêu cầu bạn phải khởi động lại.
đang được dịch, vui lòng đợi..