2012-10-21 54 views
2

我在MonoDevelop中編寫我的代碼,我想嘗試System.Threading的命名空間。我寫了這個簡單的代碼:爲什麼我不能更改線程優先級?

class MainClass { 
    public static void Main (string[] args) { 
    System.Threading.Thread thread=new System.Threading.Thread(new System.Threading.ThreadStart(ThreadProc)); 
    Console.WriteLine(thread.Priority);//output current thread priority 
    thread.Priority=System.Threading.ThreadPriority.Highest;//change thread priority 
    Console.WriteLine(thread.Priority);//output current thread priority again 
    } 
    public static void ThreadProc() { 
    //make some operations 
    } 
} 

但我看到這一點: enter image description here

也就是說,線程優先級沒有改變(OS:Ubuntu的12.10)。我怎樣才能改變線程的優先級?

+0

給線程一些工作。它開始和結束的速度非常快,而且不能改變成品線的孔隙度。也嘗試 –

+0

他還沒有啓動線程。 –

回答

2

更改線程的優先級還沒有實現。

在Github上查看source code

+1

如果有人想嘗試修復此,我建議看WIP補丁,你在這兒不會從頭開始:https://bugzilla.novell.com/show_bug.cgi?id=540524 – knocte