[英].NET DynamicMethod Thread Safe?
如果我使用ILGenerator編寫了DynamicMethod,並且我輸出的代碼是線程安全的,則生成的委托是否是線程安全的?
我擔心的是, IL是在方法第一次運行時被編譯的。 如果是這樣,那么如果其他線程在編譯時嘗試運行委托,會發生什么情況呢?
與標准委托沒有任何區別。 它們都以MSIL形式出現在某個地方, JIT可以在需要時對其進行編譯。
一旦以委托形式獲得它,便可以調用該代碼體。 這就是您真正需要知道的。 您正在其中運行的.NET的實現(Rotor,Mono,Microsoft一家)應該使您免受對此的任何考慮,否則,這是實現中的錯誤。
[英]Are .NET modules thread safe?
[英]Is .NET DateTime thread safe
[英]Thread safe collections in .NET
[英].NET: Is JsonMediaTypeFormatter thread safe?
[英]Is the .net DbProviderFactory thread safe?
[英]Thread Safe Publish Subscribe in .Net
[英]Standard Thread safe .Net Dictionary
[英]Is .NET 6 PriorityQueue thread-safe?
[英]Is snowflake net connector thread safe?
[英]Is .NET System.Net.CookieContainer thread safe?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.