c message queuee 能不能传输xml

MessageQueue的用法,该怎么解决_百度知道ACE中ACE_Message_Queue 的notify和Reactor结合使用时会导致死锁
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
/logs/.html
设置了Queue的通知策略之后,在putq之后会调用Reactor的notify方法,Reactor内部使用一个管道来传输通知事件,导致在写入通知事件时阻塞在该管道上,从而导致程序挂起。
这是一个很早就发现的bug,但是一直没有被修改。一方面是它不好修改,另一方面是ACE的维护者缺乏资金解决这个问题。
一个示例的调用栈:
(gdb) thr app all bt
Thread 4 (Thread 0xb7ad3b90 (LWP 31160)):&& # ---- Scheduler thread.
#0& 0xb80da430 in __kernel_vsyscall ()
#1& 0xb7f790e5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2& 0x08070c59 in ACE_OS::cond_wait (cv=0x91a7cbc, external_mutex=0x91a7ca0)
&&& at /home/cm/ACE_wrappers/ace/OS_NS_Thread.inl:329
#3& 0x08070c9f in ACE_Condition&ACE_Thread_Mutex&::wait (this=0x91a7cbc)
&&& at /home/cm/ACE_wrappers/ace/Condition_T.cpp:90
#4& 0x0807020a in cm::Scheduler::choose_processor (this=0x91a7c54)
&&& at /home/cm/Dropbox/projects/ace_skel/src/Scheduler.cpp:94
#5& 0x080705ad in cm::Scheduler::svc (this=0x91a7c54)
&&& at /home/cm/Dropbox/projects/ace_skel/src/Scheduler.cpp:80
#6& 0xb7daae52 in ACE_Task_Base::svc_run (args=0x91a7c54) at Task.cpp:275
#7& 0xb7dac2ed in ACE_Thread_Adapter::invoke_i (this=0x91a7fa0) at Thread_Adapter.cpp:149
#8& 0xb7dac366 in ACE_Thread_Adapter::invoke (this=0x91a7fa0) at Thread_Adapter.cpp:98
#9& 0xb7d33271 in ace_thread_adapter (args=0x91a7fa0) at Base_Thread_Adapter.cpp:124
#10 0xb7f754ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#11 0xb7ef049e in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 3 (Thread 0xb72d2b90 (LWP 31161)):&& # ---- Processor thread.
#0& 0xb80da430 in __kernel_vsyscall ()
#1& 0xb7f7c07b in write () from /lib/tls/i686/cmov/libpthread.so.0
#2& 0xb7d212ea in ACE::send (handle=6, buf=0xb72cff34, n=8, timeout=0x8)
&&& at /home/cm/ACE_wrappers/ace/OS_NS_unistd.inl:1200
#3& 0xb7d4da29 in ACE_Dev_Poll_Reactor_Notify::notify (this=0x91a3c10, eh=0x92095b0, mask=2,&
&&& timeout=0x0) at Dev_Poll_Reactor.cpp:165
#4& 0xb7d4bcbc in ACE_Dev_Poll_Reactor::notify (this=0x91a3980, eh=0x92095b0, mask=2,&
&&& timeout=0x0) at Dev_Poll_Reactor.cpp:2028
#5& 0xb7d9550e in ACE_Reactor::notify (this=0x91a38c0, event_handler=0x92095b0, mask=2, tv=0x0)
&&& at Reactor.cpp:481
#6& 0xb7d95e76 in ACE_Reactor_Notification_Strategy::notify (this=0x9209638)
&&& at Reactor_Notification_Strategy.cpp:28
#7& 0x08062d47 in ACE_Message_Queue&ACE_MT_SYNCH&::notify (this=0x9209660)
&&& at /home/cm/ACE_wrappers/ace/Message_Queue_T.cpp:1998
#8& 0x080650cc in ACE_Message_Queue&ACE_MT_SYNCH&::enqueue_tail (this=0x9209660,&
&&& new_item=0xb61bb3d8, timeout=0xb72d0064)
&&& at /home/cm/ACE_wrappers/ace/Message_Queue_T.cpp:1888
#9& 0x08076c2c in ACE_Task&ACE_MT_SYNCH&::putq (this=0x92095b0, mb=0xb61bb3d8, tv=0xb72d0064)
&&& at /home/cm/ACE_wrappers/ace/Task_T.inl:36
#10 0x in cm::RequestHandler::async_send (this=0x92095b0, mb=0xb61bb3d8)
&&& at /home/cm/Dropbox/projects/ace_skel/src/RequestHandler.cpp:257
#11 0x080746ef in cm::HttpTransaction::send_static_file (this=0x9209d10, )
&&& at /home/cm/Dropbox/projects/ace_skel/src/HttpTransaction.cpp:98
#12 0x08074c8b in cm::HttpTransaction::execute (this=0x9209d10)
&&& at /home/cm/Dropbox/projects/ace_skel/src/HttpTransaction.cpp:37
#13 0x in cm::Processor::svc (this=0x91aa128)
&&& at /home/cm/Dropbox/projects/ace_skel/src/Processor.cpp:47
#14 0xb7daae52 in ACE_Task_Base::svc_run (args=0x91aa128) at Task.cpp:275
#15 0xb7dac2ed in ACE_Thread_Adapter::invoke_i (this=0x91aa330) at Thread_Adapter.cpp:149
#16 0xb7dac366 in ACE_Thread_Adapter::invoke (this=0x91aa330) at Thread_Adapter.cpp:98
#17 0xb7d33271 in ace_thread_adapter (args=0x91aa330) at Base_Thread_Adapter.cpp:124
#18 0xb7f754ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#19 0xb7ef049e in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 2 (Thread 0xb6ad1b90 (LWP 31162)):&& # ---- Processor thread
#0& 0xb80da430 in __kernel_vsyscall ()
#1& 0xb7f7c07b in write () from /lib/tls/i686/cmov/libpthread.so.0
#2& 0xb7d212ea in ACE::send (handle=6, buf=0xb6acef34, n=8, timeout=0x8)
&&& at /home/cm/ACE_wrappers/ace/OS_NS_unistd.inl:1200
#3& 0xb7d4da29 in ACE_Dev_Poll_Reactor_Notify::notify (this=0x91a3c10, eh=0x9209448, mask=2,&
&&& timeout=0x0) at Dev_Poll_Reactor.cpp:165
#4& 0xb7d4bcbc in ACE_Dev_Poll_Reactor::notify (this=0x91a3980, eh=0x9209448, mask=2,&
&&& timeout=0x0) at Dev_Poll_Reactor.cpp:2028
#5& 0xb7d9550e in ACE_Reactor::notify (this=0x91a38c0, event_handler=0x9209448, mask=2, tv=0x0)
&&& at Reactor.cpp:481
#6& 0xb7d95e76 in ACE_Reactor_Notification_Strategy::notify (this=0x92094d0)
&&& at Reactor_Notification_Strategy.cpp:28
#7& 0x08062d47 in ACE_Message_Queue&ACE_MT_SYNCH&::notify (this=0x92094f8)
&&& at /home/cm/ACE_wrappers/ace/Message_Queue_T.cpp:1998
#8& 0x080650cc in ACE_Message_Queue&ACE_MT_SYNCH&::enqueue_tail (this=0x92094f8,&
&&& new_item=0x92f5c38, timeout=0xb6acf064)
&&& at /home/cm/ACE_wrappers/ace/Message_Queue_T.cpp:1888
#9& 0x08076c2c in ACE_Task&ACE_MT_SYNCH&::putq (this=0x9209448, mb=0x92f5c38, tv=0xb6acf064)
&&& at /home/cm/ACE_wrappers/ace/Task_T.inl:36
#10 0x in cm::RequestHandler::async_send (this=0x9209448, mb=0x92f5c38)
&&& at /home/cm/Dropbox/projects/ace_skel/src/RequestHandler.cpp:257
#11 0x in cm::HttpTransaction::send_static_file (this=0x9209bc0, )
&&& at /home/cm/Dropbox/projects/ace_skel/src/HttpTransaction.cpp:110
#12 0x08074c8b in cm::HttpTransaction::execute (this=0x9209bc0)
&&& at /home/cm/Dropbox/projects/ace_skel/src/HttpTransaction.cpp:37
#13 0x in cm::Processor::svc (this=0x91ac488)
&&& at /home/cm/Dropbox/projects/ace_skel/src/Processor.cpp:47
#14 0xb7daae52 in ACE_Task_Base::svc_run (args=0x91ac488) at Task.cpp:275
#15 0xb7dac2ed in ACE_Thread_Adapter::invoke_i (this=0x91ac690) at Thread_Adapter.cpp:149
#16 0xb7dac366 in ACE_Thread_Adapter::invoke (this=0x91ac690) at Thread_Adapter.cpp:98
#17 0xb7d33271 in ace_thread_adapter (args=0x91ac690) at Base_Thread_Adapter.cpp:124
#18 0xb7f754ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#19 0xb7ef049e in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 1 (Thread 0xb7ad48e0 (LWP 31159)):& # ---- Reactor thread.
#0& 0xb80da430 in __kernel_vsyscall ()
#1& 0xb7f790e5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2& 0xb7d3c254 in ACE_Condition_Thread_Mutex::wait (this=0x91ae99c, , abstime=0x0)
---Type &return& to continue, or q &return& to quit---
&&& at /home/cm/ACE_wrappers/ace/OS_NS_Thread.inl:362
#3& 0xb7d3c2bb in ACE_Condition_Thread_Mutex::wait (this=0x91ae99c, abstime=0x0)
&&& at Condition_Thread_Mutex.cpp:107
#4& 0x08063c90 in ACE_Message_Queue&ACE_MT_SYNCH&::wait_not_full_cond (this=0x91ae920,&
&&& timeout=0x0) at /home/cm/ACE_wrappers/ace/Message_Queue_T.cpp:1715
#5& 0x08064e38 in ACE_Message_Queue&ACE_MT_SYNCH&::enqueue_head (this=0x91ae920,&
&&& new_item=0xb6105610, timeout=0x0) at /home/cm/ACE_wrappers/ace/Message_Queue_T.cpp:1777
#6& 0x0807236a in ACE_Task&ACE_MT_SYNCH&::ungetq (this=0x91ae870, mb=0xb6105610, tv=0x0)
&&& at /home/cm/ACE_wrappers/ace/Task_T.inl:43
#7& 0x08071d5d in cm::HttpRequestHandler::handle_output (this=0x91ae870)
&&& at /home/cm/Dropbox/projects/ace_skel/src/HttpRequestHandler.cpp:86
#8& 0xb7d4d982 in ACE_Dev_Poll_Reactor_Notify::dispatch_notify (this=0x91a3c10,&
&&& ) at Dev_Poll_Reactor.cpp:365
#9& 0xb7d4c91b in ACE_Dev_Poll_Reactor_Notify::handle_input (this=0x91a3c10, handle=5)
&&& at Dev_Poll_Reactor.cpp:297
#10 0xb7d4f945 in ACE_Dev_Poll_Reactor::dispatch_io_event (this=0x91a3980, )
&&& at /home/cm/ACE_wrappers/ace/Dev_Poll_Reactor.inl:126
#11 0xb7d4fb4c in ACE_Dev_Poll_Reactor::dispatch (this=0x91a3980, )
&&& at Dev_Poll_Reactor.cpp:1079
#12 0xb7d4fca6 in ACE_Dev_Poll_Reactor::handle_events_i (this=0x91a3980, max_wait_time=0x0,&
&&& ) at Dev_Poll_Reactor.cpp:1056
#13 0xb7d4fd7c in ACE_Dev_Poll_Reactor::handle_events (this=0x91a3980, max_wait_time=0x0)
&&& at Dev_Poll_Reactor.cpp:1012
#14 0xb7d94fc3 in ACE_Reactor::run_reactor_event_loop (this=0x91a38c0, eh=0) at Reactor.cpp:224
#15 0x in main (argc=7, argv=0xbfaf5f04)
&&& at /home/cm/Dropbox/projects/ace_skel/src/main.cpp:75
#0& 0xb80da430 in __kernel_vsyscall ()
把ACE_Message_Queue的high water level设置为一个很高的值,避免队列满触发该bug。
/group/comp.soft-sys.ace/browse_thread/thread/3575b21beae71683?pli=1
/group/comp.soft-sys.ace/browse_thread/thread/38fb11cf258f3eec
> 本站内容系网友提交或本网编辑转载,其目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权和其它问题,请及时与本网联系,我们将在第一时间删除内容!
ACE中提供了丰富的timer功能,下面这幅图为我们展示了,在ACE中,Timer的层次关系.
在ACE中,类ACE_Timer_Queue_T是接口类,提供对timer的公共方法的抽象.ACE为用户提供了四种timer的实现,这四种实现的区别主要在于timer节点数据结构的组织,以及采用的查找算法.对于四种实现,ACE_Timer_Heap_T的性 ...
ACE中的Proactor和Reactor
ACE_Select_Reactor是除Windows之外所有平台使用的默认反应器实现,在这些系统上最终会用select()系统函数进行等待.在Windows上ACE_WFMO_Reactor是默认的反应器实现.该实现没有使用select()多路分离器,而是使用了WaitForMultipleObj ...
ACE中的设计模式(3)——Strategy Joise.LI @ ,FYT04121
Strategy模式简介 Strategy模式定义了不同算法的接口,分别封装起来,让他们彼此之间可以互相替换,带来的好处是把系统中容易发生变化的部分与稳定的部分隔离开来,该模式对于后续的维护是非常有用的. 使用Strateg ...
最近在整理以前所看文章内容时,发现了几篇2003年程序员合订本里关于 ACE的文章,当年这几篇文章中所谈到的内容就让人非常兴奋,因为在那个国内热火朝天学习设计模式的几年里,这几篇文章因为其内容涉及到了bridge, strategy, adapter, facade等模式在这个网络通信框架中实打实的应用,让我切身体会到了面向对象设计模式的强大火力.同时因为这 ...
占位,准备写如何几篇学习笔记文章ACE中的多线程,线程池,线程同步ACE中的定时器ACE Reactor框架ACE Service Configurator框架ACE Task框架ACE Proactor框架ACE的事件多路分离器ACE Proactor在Windows下是不是IOCP?ACEXML介绍及使用ACEXML性能分析ACE的性能分析使用ACE开 ...
/ace-2002-12/Index of /ace-2002-12/ACE中文文档 * ACE自适配通信环境(代序) * 上篇:ACE技术论文集 * 第1章 ACE自适配通信环境:用于开发通信软件的面向对象网络编程工具包 * 第2章 包装外观(Wrapper Facade):用于在类中封装函数的结构型模式 * 第3章 ...
原文链接:/daizhj/archive//1270085.html 最近在整理以前所看文章内容时,发现了几篇2003年程序员合订本里关于 ACE的文章,当年这几篇文 章中所谈到的内容就让人非常兴奋,因为在那个国内热火朝天学习设计模式的几年里,这几篇文章因为其内 容涉及到了bridge, str ...
介绍了ACE中日志系统(Logging Facility)的基本使用一.简介以前曾介绍过一个开源日志系统log4cplus,ACE也有自己的Logging Facility,与log4cplus相似,ACE日志系统也具有线程安全.灵活.分级显示等特点,可以面向程序调试.运行.测试.和维护等全生命周期,可以选择将信息输出到屏幕.文件.系统日志(如Windows ...消息队列(Message_Queue)简介及其使用_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
消息队列(Message_Queue)简介及其使用
上传于||文档简介
&&数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法​数​据​结​构​与​算​法
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩3页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢

我要回帖

更多关于 linux message queue 的文章

 

随机推荐