摘 要: 建立了一套基于多線程技術的天線實時測量系統。實時測量系統具有很高的實時性要求,多線程技術以其能同時執行多項任務、最大程度利用多處理器性能的獨特優點很好地滿足了這一要求。系統軟件用戶界面可以完成所有測量參數的輸入和設置并及時響應用戶操作,除此線程外建立額外的工作者線程實現其他功能的并行工作,提高系統實時性,在用戶界面實時更新顯示儀器的運行狀態和系統的測量進度以供用戶了解系統狀態,同時對測量數據進行實時地讀取和保存,便于后期的進一步處理和研究。
關鍵字: 多線程技術; 天線; 實時測量系統; 用戶界面; 并行工作
中圖分類號: TN820?34 文獻標識碼: A 文章編號: 1004?373X(2013)13?0115?05
Antenna real?time measuring system based on multithreading technology
HAN Xu, WEI Gao, LI Rui?yang, FU Li
(School of Electronics and Information, Northwestern Polytechnical University, Xi’an 710129, China)
Abstract: An antenna real?time measuring system based on multithreading technology was established, which has high demand of real?time. Multithreading technology with its unique advantages can well meet the need , which can carry out multi?tasks concurrently and make full use of the performance of multiprocessor. All measured parameters could be inpu into the syetem software UI, and the UI would respond the user operation timely. In addition to this thread, extra worker threads could be created to make additional functions work in parallel, thus the real?time of the system is increased. The running status of the instruments and the measuring progress of the system is updated and displayed in real?time on the UI so as to show the system status to users. At the same time, the measuring data is read and saved in real?time for further dispose and research in the future.
Keywords: multithreading technology; antenna; real?time measuring system; UI; concurrent working
0 引 言
隨著計算機技術和現代電子測量技術在儀器領域的應用和普及,特別是電子測量儀器計算機接口及相應標準的出現,使得計算機與儀器間的通信簡單易得,用戶可以通過計算機程序進行儀器控制和數據讀取與存儲,這些技術的發展使得天線自動測量系統的實現成為可能[1?4]。
以往基于單線程的簡單測量系統,對用戶操作的響應以及多任務之間的切換需要使用“中斷處理”來完成,極大地影響了系統的實時性和工作效率,測量過程中軟件進入數據讀取與存儲的循環過程,使得用戶界面進入“假死”狀態,無法對測量進行控制和了解系統測量的實時進度。為了彌補這些不足,需要做到多任務的并行工作,而多線程技術以其避免阻塞、同時執行多項任務、減小運行過程和用戶界面的相互影響,以及最大程度地利用多處理器性能的獨特優點很好地滿足了這一要求[5?6]。……