Show Table of Contents
A.16. taskset
「taskset」工具由 「util-linux」套件提供。 此工具使系統管理員能夠取出並設定運作中的處理器親合性(processor affinity),或使用特定處理器親和性(processor affinity)啟動程序。
重要
「taskset」並不能保證本地記憶體分配。 若您請求本地記憶體分配額外效能益處,Red Hat 建議您使用「numactl 」,取代使用 taskset。
欲設定一運作中程序的 CPU 親合性 (CPU affinity), 請運作以下命令:
# taskset -c processors pid
以處理序的逗點分隔列表或處理序範圍,取代「processors」(例如:「
1,3,5-7」)。以您所希望重新設定的程序辨識器,取代「pid」。
欲使用特定親和性(specified affinity)啟動程序,請運作以下命令:
# taskset -c processors -- application
以處理器的逗點分隔列表或處理器的範圍,取代「processors」。 以命令、選項和您所希望運作的應用程式引數,取代「application 」。
更多有關「taskset」的資訊,請參閱 man page:
$ man taskset

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.