boost :: object_pool是否同步?boost :: object_pool是否同步?
0
A
回答
4
0
boost::object_pool
不同步用於同時訪問和釋放池中的對象。但如果你想同步池,singleton_pool
從boost是一個。關於如何開始使用singleton_pool
幾乎沒有限制,但它們非常公平並適用於所有應用程序。請參閱here和here的啓動文檔中的以下注釋。
Object Usage vs. Singleton Usage
Object Usage is the method where each Pool is an object that may be created and destroyed. Destroying a Pool implicitly frees all chunks that have been allocated from it.
Singleton Usage is the method where each Pool is an object with static duration; that is, it will not be destroyed until program exit. Pool objects with Singleton Usage may be shared; thus, Singleton Usage implies thread-safety as well. System memory allocated by Pool objects with Singleton Usage may be freed through release_memory or purge_memory.
singleton_pool
用途限制
Notes
The underlying pool p referenced by the static functions in singleton_pool is actually declared in a way that it is:
Thread-safe if there is only one thread running before main() begins and after main() ends -- all of the static functions of singleton_pool synchronize their access to p.
Guaranteed to be constructed before it is used -- thus, the simple static object in the synopsis above would actually be an incorrect implementation. The actual implementation to guarantee this is considerably more complicated.
Note that a different underlying pool p exists for each different set of template parameters, including implementation-specific ones.
相關問題
- 1. boost object_pool構造方法
- 2. 的boost :: object_pool ::建設()在Visual C++
- 3. Boost線程同步
- 4. Silverlight:HtmlPage.Window.Invoke()是否同步?
- 5. @ModelAttribute是否同步?
- 6. connectionWithRequest是否同步?
- 7. LayoutInflater.inflate()是否同步?
- 8. clEnqueueNDRangeKernel是否同步?
- 9. System.Net.Mail.SmtpClient.Send是否同步?
- 10. boost :: signals slots是同步調用還是異步調用?
- 11. boost :: asio,線程和同步
- 12. 線程同步與boost :: condition_variable
- 13. 使用boost :: object_pool不能清晰地退出。我濫用了嗎?
- 14. 檢測是否SQL同步
- 15. Guava Striped.get(key)是否同步?
- 16. Redis更新是否同步?
- 17. FTP通信是否同步?
- 18. S3方法是否同步?
- 19. 檢查Dropbox是否同步
- 20. jQuery.remove()是否真的同步?
- 21. NSStream.close()是否與TCP同步?
- 22. SOAP交易 - 是否同步?
- 23. 這是否需要同步?
- 24. iOS:NSUserDefaults是否與iCloud同步?
- 25. WifiManager.setWifiEnabled方法是否同步?
- 26. Monitor.Wait是否需要同步?
- 27. 同步語句 - 同步方法和同步語句是否相同?
- 28. boost :: asio:「strand」類型的同步原語是否有任何名稱?
- 29. 要使用boost :: object_pool來實現map的自定義分配器,如何使用boost :: object_pool分配n個連續元素?
- 30. BOOST ::線程工人同步,C++和OpenCV
請解釋一下你的「同步」的意思,因爲這學期沒有在C的具體含義++像它在Java中,例如。 – 2009-11-02 19:59:54
我的意思是線程安全 – chila 2009-11-02 20:05:46
然後不,它不是 – KeatsPeeks 2009-11-02 20:09:29