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