在Mac OS X中,我可以利用GCD(Grand Central Dispatch)的多個內核。什麼是Visual Basic程序的等效物?用於Visual Basic的Grand Central Dispatch?
0
A
回答
1
VB.NET中的線程化可以非常簡單。
Shared Sub New()
Dim t As New System.Threading.Thread(AddressOf GetWebpage)
t.Start()
End Sub
以上所有內容都是讓函數在自己的線程中執行。
下面是被調用的函數:
Private Shared Sub GetWebpage()
Dim URL As String = ConfigurationManager.AppSettings("AppCacheURL")
Dim REQ As System.Net.HttpWebRequest = System.Net.WebRequest.Create(URL & "?Task=PopulateURLCache&Payload=App_Start")
REQ.GetResponse()
End Sub
這是一個asyncronous調用該觸發一個HTTP請求到網頁功能的一個簡單的例子。原始代碼在錯誤處理和日誌記錄方面稍微複雜一點,但它基本上會導致「保持活動」樣式的aspx頁面被訪問,而不會減慢調用應用程序的速度。 (消防和忘記)
如果你需要一個框架或庫,以實現自己的目標,看看:
0
你應該看看在PLINQ和Task Parallel Library,這兩者都可以用於利用主機中可用的內核數量進行性能ming CPU綁定操作。
Joseph Albahari在使用並行編程技術(在C#中)上有一個great tutorial,但是同樣的概念適用於VB.NET。
相關問題
- 1. Grand Central Dispatch等效於omp_get_thread_num
- 2. Grand Central Dispatch與Cilk ++
- 3. Swift - Grand Central Dispatch Class
- 4. Grand Central Dispatch(GCD)和CoreData
- 5. 基於Grand Central Dispatch(GCD)的Web框架?
- 6. 雙核iPad(A5)= Grand Central Dispatch?
- 7. Swift - Grand Central Dispatch vs Blocks/Closures
- 8. 使用Grand Central Dispatch「Throttle」指令隊列
- 9. 我是否正確使用Grand Central Dispatch?
- 10. 使用Grand Central Dispatch(GCD)時獲取OSSpinLockLock
- 11. Grand Central Dispatch尋找不同的方法
- 12. Grand Central Dispatch(GCD)調度源標記
- 13. 如何從Grand Central Dispatch獲取數組?
- 14. Grand Central Dispatch沒有顯示NSLog語句
- 15. Qt中有什麼類似Grand Central Dispatch?
- 16. 任何類似於Objective-C之外的Grand Central Dispatch?
- 17. 使用Grand Central Dispatch和UINavigationController的用戶界面問題
- 18. iOS:如何在使用Grand Central Dispatch(GCD)時同步我的managedObjectContext?
- 19. 爲什麼要使用OpenMP上的Grand Central Dispatch?
- 20. 正確使用具有多個UIActivityIndicatorViews的Grand Central Dispatch
- 21. 使用Grand Central Dispatch時,何時可以安全調用dispatch_io_close()?
- 22. 來自Grand Central Dispatch的dispatch_async()和來自C++的std :: async 11
- 23. 是否可以在Windows上使用Grand Central Dispatch(`libdispatch`)?
- 24. Grand Central Dispatch如何真正使用操作系統?
- 25. 用Grand Central Dispatch(GCD)創建N個線程
- 26. 在connectionDidFinishLoading中使用Grand Central Dispatch解析JSON:?
- 27. 如何使用Grand Central Dispatch並行化Sudoku解算器?
- 28. 如何在iOS中使用Grand Central Dispatch在.c文件中
- 29. 如何在使用Grand Central Dispatch時發佈NSNotification?
- 30. Grand Central Dispatch中的線程數和線程數
如果您準確解釋了GCD的作用,您的問題就會得到改善。 – 2011-05-28 16:17:33
[看起來可以。](http://developer.apple.com/technologies/mac/snowleopard/gcd.html) – 2011-05-28 16:19:43
Visual Basic .NET? [並行框架](http://en.wikipedia.org/wiki/Parallel_Extensions)可能是最接近的等效框架。 – 2011-05-28 16:20:13