2015-06-26 74 views
0

我只是想知道,如果我有天青舉辦一個輔助角色會發生什麼,而不是Azure的服務費,輔助角色

public class WorkerRole : RoleEntryPoint 
    { 
     public override void Run() 
     { 
      while (true) 
      { 
       Thread.Sleep(10000); 
       Trace.TraceInformation("Working", "Information"); 
      } 
     } 

    //Other code remove for brevity 
    } 
} 

我做

public class WorkerRole : RoleEntryPoint 
     { 
      public override void Run() 
      { 
       while (true) 
       {      
       } 
      } 

     //Other code remove for brevity 
     } 
    } 

我知道,第二個代碼片段一直在旋轉這個進程,這很糟糕。但是在金錢方面有沒有其他差異?

謝謝。

回答

1

只要你不產生網絡傳輸,那麼第二個while(true)代碼會簡單地阻塞你的工作角色的主線程,如果每個迭代需要幾毫秒來處理。

您可以使用Azure Pricing Calculator for cloud services(您會發現您每個月根據CPU功率和RAM支付固定價格,同時也基於網絡帶寬支付工資角色的支付方式)。

相關問題