刘邦属什么生肖| 底线是什么意思| 肠炎吃什么药效果好| 吃了螃蟹不能吃什么| 冰激凌和冰淇淋有什么区别| 中国的国服是什么服装| europe是什么意思| 贫血有什么危害| 烧烤烤什么好吃| 肩周炎是什么引起的| 心脏早搏有什么危害| 纨绔子弟是什么意思| 网调是什么意思| 阴部瘙痒是什么原因| 蚂蚁上树什么姿势| 包皮红肿用什么药| 洗衣机什么牌子的好| 胆结石吃什么最好| 什么是密度| 人为什么要死| 心绞痛什么感觉| 病毒性感冒咳嗽吃什么药效果好| 鱼泡是什么| 什么是胰腺炎| 笑字五行属什么| 刚出生的小鱼苗吃什么| 乌克兰和俄罗斯为什么打仗| 肾积液是什么原因造成的| lisa英文名什么意思| 牛腩是什么| 10月是什么季节| ev病毒是什么| 人为什么会打呼噜| 料酒和黄酒有什么区别| LC是什么| 缺二氧化碳是什么症状| 榆木脑袋是什么意思| 尿道口下裂是什么样子| 吃汉堡为什么要配可乐| 为什么老是犯困想睡觉| 师姐是什么意思| 蔡司是什么| 脚麻木是什么原因引起的| 后背痒是什么原因| 腺瘤型息肉是什么意思| 勃起不硬吃什么药| 哆啦a梦的口袋叫什么| 党费什么时候开始交| 儿童过敏性鼻炎吃什么药| 复方对乙酰氨基酚片是什么药| 女性膀胱炎吃什么药| 什么时候喝牛奶最好| 九斗一簸箕有什么说法| 房东是什么意思| xxoo什么意思| 上海市市长是什么级别| 早上出汗是什么原因| 什么时候长智齿| 女人有腰窝意味着什么| 单元剧是什么意思| 月经期生气会造成什么后果| 蛇为什么怕雄黄| 血余炭是什么制成的| 白天不咳嗽晚上咳嗽吃什么药| py什么意思| 什么季节掉头发最厉害| 洛神是什么意思| 嗜酸性粒细胞偏低是什么意思| 不以规矩下一句是什么| 金句是什么意思| 拍身份证照片穿什么颜色衣服好看| 红螺寺求什么最灵验| 孕妇牙龈出血是什么原因| 梦见偷鸡是什么预兆| 心跳慢是什么原因| 阴部潮湿是什么原因| 螃蟹一般吃什么| 绿茶婊是什么意思| 排卵期后面是什么期| 皮肤黑穿什么颜色的衣服| 编程是干什么的| 4.26是什么星座| 文雅什么意思| 梦见老公怀孕什么预兆| 9k金是什么意思| 3000年前是什么朝代| 小狗什么时候换牙| 白羊女和什么星座最配| 点茶是什么意思| 脚底板发红是什么原因| 什么是无为| 诊刮是什么手术| 属猴是什么命| 欧珑香水什么档次| 什么的原始森林| 撇嘴是什么意思| 血糖高会有什么症状| 脸上肉跳动是什么原因| 白内障是什么引起的| 生津止渴是什么意思| 毛笔是用什么毛做的| 耳朵听不清楚是什么原因| 晚上吃什么不胖| 那天午后我站在你家门口什么歌| hbsag阳性是什么意思| 混剪是什么意思| 粉条是什么做的| 春砂仁与什么煲汤最佳| 直肠腺瘤是什么| 荷花的别称是什么| 免疫球蛋白g是什么意思| ads是什么意思| 尿素氮偏低是什么意思| 爱是什么偏旁| 儿童干咳吃什么药效果好| 7月7日什么星座| 检查头部应该挂什么科| 为什么会打雷闪电| 懊恼是什么意思| 红茶适合什么季节喝| 家里进蝴蝶有什么预兆| 你太low了是什么意思| 为什么讨厌犹太人| 一什么黑暗| 豆芽不能和什么一起吃| nb什么牌子| 黑镜讲的是什么| 爆表是什么意思| 贫血要做什么检查| 文曲星是什么神仙| 沐猴而冠代表什么生肖| 孩子铅高有什么症状| 乙肝三抗体阳性是什么意思| 烧心吃什么马上能缓解| 什么地照着| 孝是什么| 心肌缺血吃什么药效果最好| 做梦梦见被蛇咬是什么意思| 儿童发育过早应该挂什么科| 晚上五点是什么时辰| 枉然是什么意思| 痛风应该挂什么科| 什么星空| 什么东西蛋白质含量高| 头顶头发稀少是什么原因| 霉菌性阴道炎用什么药好| 菊花茶泡了为什么会变绿| 人参有什么功效| 小兔子吃什么食物| 螺旋ct检查什么| 便秘吃什么药见效快| dei是什么意思| 国家副主席是什么级别| 包馄饨用猪肉什么部位| iphone5什么时候出的| 夜不能寐是什么意思| 12点到1点是什么时辰| 杨柳代表什么生肖| 紫萱名字的含义是什么| 八零年属什么生肖| 淋巴细胞绝对值偏高是什么意思| 看见喜鹊有什么预兆| rh血型阳性是什么意思| 梦到小男孩是什么意思| 四面佛是什么佛| 颈动脉在什么位置| 好事多磨是什么意思| reed是什么意思| 小孩咳嗽有痰吃什么药| 口蜜腹剑是什么意思| 李世民和武则天什么关系| 朱元璋为什么不杀朱棣| 奎宁是什么药| 维生素b5药店叫什么| 梦到手机丢了什么预兆| 什么是黄疸| 什么的树丛| 女性下体长什么样| 什么是根管治疗牙齿| 特斯拉发明了什么| 哺乳期乳腺炎吃什么药| 单车是什么意思| 蝶窦囊肿是什么病| 组织部长是什么级别| 环移位了有什么症状| 素描是什么意思| 禾字五行属什么| 林彪为什么叛变| 腰疼不能弯腰是什么原因引起的| 师兄是什么意思| 梦到吃花生是什么意思| 长脸适合什么刘海| 大势至菩萨代表什么| 生门是什么意思| 什么是性侵| 人乳头瘤病毒是什么| 肌钙蛋白高是什么原因| 支原体吃什么药最有效| 什么是性骚扰| 5月24日是什么星座| 排卵日是什么意思| 巨蟹什么象星座| 心字旁的字有什么| 小麦粉可以做什么| 吃什么 长高| 土豆粉是什么做的| 炒熟的黑豆有什么功效| 血压高吃什么降压药| 湿热吃什么药| 好五行属什么| 广西属于什么地区| 梦见别人穿红衣服是什么意思| 内膜厚是什么原因| 发烧惊厥是什么症状| 处暑是什么时候| 吃生葵花籽有什么好处和坏处吗| 胃不舒服吃什么| 类风湿不能吃什么东西| 薄荷叶有什么功效| 肉桂跟桂皮有什么区别| 什么食物降火| 11月12号是什么星座| 落魄是什么意思| 传度是什么意思| 补肾吃什么| 点了斑不能吃什么| 处子之身是什么意思| 五月是什么生肖| 离婚需要什么手续| 八纲辨证中的八纲是什么| 血小板体积偏低是什么原因| 阴阳怪气什么意思| 亚型是什么意思| 孕早期胎停有什么症状或征兆吗| 男人吃洋葱有什么好处| 朔望月是什么意思| 什么什么言什么| 云南白药气雾剂保险液有什么作用| 野鸡吃什么食物| 梦见红棺材是什么征兆| 宜祭祀是什么意思| 防蓝光眼镜有什么好处| 肛门坠胀吃什么药最好| 老年人嗜睡是什么原因| 状元是什么官| 才高八斗是什么生肖| ro是什么意思| 出虚汗吃什么中成药| 芙字五行属什么| 痰湿阻滞吃什么中成药| 蒟蒻是什么意思| 日新月异什么意思| 舌苔白厚腻吃什么药见效快| 铁蛋白高吃什么食物好| 乔迁新居送什么礼物| 国药准字号是什么意思| 为什么海藻敷完那么白| 医院打耳洞挂什么科| 养胃吃什么食物最好| 马拉松起源与什么有关| 1月2日是什么星座| 小螃蟹吃什么食物| 鼻腔有臭味是什么原因| 佛牌是什么| 百度Jump to content

中国记协网(中华新闻传媒网)

From Wikipedia, the free encyclopedia
百度 就在安倍道歉的相关报道文末,日本网友也是表达了对自己首相的强烈不满。

In computer science, message queues and mailboxes are software-engineering components typically used for inter-process communication (IPC), or for inter-thread communication within the same process. They use a queue for messaging – the passing of control or of content. Group communication systems provide similar kinds of functionality.

The message queue paradigm is a sibling of the publisher/subscriber pattern, and is typically one part of a larger message-oriented middleware system. Most messaging systems support both the publisher/subscriber and message queue models in their API, e.g. Java Message Service (JMS).

Competing Consumers pattern enables multiple concurrent consumers to process messages on the same message queue. [1]

Remit and ownership

[edit]

Message queues implement an asynchronous communication pattern between two or more processes/threads whereby the sending and receiving party do not need to interact with the message queue at the same time. Messages placed onto the queue are stored until the recipient retrieves them. Message queues have implicit or explicit limits on the size of data that may be transmitted in a single message and the number of messages that may remain outstanding on the queue.[2]

Remit

[edit]

Many implementations of message queues function internally within an operating system or within an application. Such queues exist for the purposes of that system only.[3][4][5]

Other implementations allow the passing of messages between different computer systems, potentially connecting multiple applications and multiple operating systems.[6] These message queuing systems typically provide resilience functionality to ensure that messages do not get "lost" in the event of a system failure. Examples of commercial implementations of this kind of message queuing software (also known as message-oriented middleware) include IBM MQ (formerly MQ Series) and Oracle Advanced Queuing (AQ). There is a Java standard called Java Message Service, which has several proprietary and free software implementations.

Real-time operating systems (RTOSes) such as VxWorks and QNX encourage the use of message queuing as the primary inter-process or inter-thread communication mechanism. This can result in integration between message passing and CPU scheduling. Early examples of commercial RTOSes that encouraged a message-queue basis to inter-thread communication also include VRTX and pSOS+, both of which date to the early 1980s. The Erlang programming language uses processes to provide concurrency; these processes communicate asynchronously using message queuing.

Ownership

[edit]

The message queue software can be either proprietary, open source or a mix of both. It is then run either on premise in private servers or on external cloud servers (message queuing service).

Examples on hardware-based messaging middleware vendors are Solace, Apigee, and IBM MQ.

Usage

[edit]

In a typical message-queueing implementation, a system administrator installs and configures message-queueing software (a queue manager or broker), and defines a named message queue. Or they register with a message queuing service.

An application then registers a software routine that "listens" for messages placed onto the queue.

Second and subsequent applications may connect to the queue and transfer a message onto it.

The queue-manager software stores the messages until a receiving application connects and then calls the registered software routine. The receiving application then processes the message in an appropriate manner.

There are often numerous options as to the exact semantics of message passing, including:

  • Durability – messages may be kept in memory, written to disk, or even committed to a DBMS if the need for reliability indicates a more resource-intensive solution.
  • Security policies – which applications should have access to these messages?
  • Message purging policies – queues or messages may have a "time to live".
  • Message filtering – some systems support filtering data so that a subscriber may only see messages matching some pre-specified criteria of interest.
  • Delivery policies – do we need to guarantee that a message is delivered at least once, or no more than once?
  • Routing policies – in a system with many queue servers, what servers should receive a message or a queue's messages?
  • Batching policies – should messages be delivered immediately? Or should the system wait a bit and try to deliver many messages at once?
  • Queuing criteria – when should a message be considered "enqueued"? When one queue has it? Or when it has been forwarded to at least one remote queue? Or to all queues?
  • Receipt notification – A publisher may need to know when some or all subscribers have received a message.

These are all considerations that can have substantial effects on transaction semantics, system reliability, and system efficiency.

Standards and protocols

[edit]

Historically, message queuing has used proprietary, closed protocols, restricting the ability for different operating systems or programming languages to interact in a heterogeneous set of environments.

An early attempt to make message queuing more ubiquitous was Sun Microsystems' JMS specification, which provided a Java-only abstraction of a client API. This allowed Java developers to switch between providers of message queuing in a fashion similar to that of developers using SQL databases. In practice, given the diversity of message queuing techniques and scenarios, this wasn't always as practical as it could be.

Three standards have emerged which are used in open source message queue implementations:

  1. Advanced Message Queuing Protocol (AMQP) – feature-rich message queue protocol, approved as ISO/IEC 19464 since April 2014
  2. Streaming Text Oriented Messaging Protocol (STOMP) – simple, text-oriented message protocol
  3. MQTT (formerly MQ Telemetry Transport) – lightweight message queue protocol especially for embedded devices

These protocols are at different stages of standardization and adoption. The first two operate at the same level as HTTP, MQTT at the level of TCP/IP.

Some proprietary implementations also use HTTP to provide message queuing by some implementations, such as Amazon's SQS. This is because it is always possible to layer asynchronous behaviour (which is what is required for message queuing) over a synchronous protocol using request-response semantics. However, such implementations are constrained by the underlying protocol in this case and may not be able to offer the full fidelity or set of options required in message passing above.

Synchronous vs. asynchronous

[edit]

Many of the more widely known communications protocols in use operate synchronously. The HTTP protocol – used in the World Wide Web and in web services – offers an obvious example where a user sends a request for a web page and then waits for a reply.

However, scenarios exist in which synchronous behaviour is not appropriate. For example, AJAX (Asynchronous JavaScript and XML) can be used to asynchronously send text, JSON or XML messages to update part of a web page with more relevant information. Google uses this approach for their Google Suggest, a search feature which sends the user's partially typed queries to Google's servers and returns a list of possible full queries the user might be interested in the process of typing. This list is asynchronously updated as the user types.

Other asynchronous examples exist in event notification systems and publish/subscribe systems.

  • An application may need to notify another that an event has occurred, but does not need to wait for a response.
  • In publish/subscribe systems, an application "publishes" information for any number of clients to read.

In both of the above examples it would not make sense for the sender of the information to have to wait if, for example, one of the recipients had crashed.

Applications need not be exclusively synchronous or asynchronous. An interactive application may need to respond to certain parts of a request immediately (such as telling a customer that a sales request has been accepted, and handling the promise to draw on inventory), but may queue other parts (such as completing calculation of billing, forwarding data to the central accounting system, and calling on all sorts of other services) to be done some time later.

In all these sorts of situations, having a subsystem which performs message-queuing (or alternatively, a broadcast messaging system) can help improve the behavior of the overall system.

Implementation in UNIX

[edit]

There are two common message queue implementations in UNIX. One is part of the SYS V API, the other one is part of POSIX.

SYS V

[edit]

UNIX SYS V implements message passing by keeping an array of linked lists as message queues. Each message queue is identified by its index in the array, and has a unique descriptor. A given index can have multiple possible descriptors. UNIX gives standard functions to access the message passing feature.[7]

msgget()
This system call takes a key as an argument and returns a descriptor of the queue with the matching key if it exists. If it does not exist, and the IPC_CREAT flag is set, it makes a new message queue with the given key and returns its descriptor.
msgrcv()
Used to receive a message from a given queue descriptor. The caller process must have read permissions for the queue. It is of two types.[8]
  • Blocking receive puts the child to sleep if it cannot find a requested message type. It sleeps until another message is posted in the queue, and then wakes up to check again.
  • Non-blocking receive returns immediately to the caller, mentioning that it failed.
msgctl()
Used to change message queue parameters like the owner. Most importantly, it is used to delete the message queue by passing the IPC_RMID flag. A message queue can be deleted only by its creator, owner, or the superuser.

POSIX

[edit]

The POSIX.1-2001 message queue API is the later of the two UNIX message queue APIs. It is distinct from the SYS V API, but provides similar function. The unix man page mq_overview(7) provides an overview of POSIX message queues.

Graphical user interfaces

[edit]

Graphical user interfaces (GUIs) employ a message queue, also called an event queue or input queue, to pass graphical input actions, such as mouse clicks, keyboard events, or other user inputs, to the application program.[9] The windowing system places messages indicating user or other events, such as timer ticks or messages sent by other threads, into the message queue. The GUI application removes these events one at a time by calling a routine called getNextEvent() or similar in an event loop, and then calling the appropriate application routine to process that event.[10]

See also

[edit]

References

[edit]
  1. ^ Gorton, Ian. Foundations of Scalable Systems. O'Reilly Media. ISBN 9781098106034.
  2. ^ Dive Into Queue Module In Python. Overview of POSIX message queues
  3. ^ Win32 system message queues. "About Messages and Message Queues". Windows User Interface. Microsoft Developer Network. Archived from the original on March 17, 2012. Retrieved April 21, 2010.
  4. ^ Linux and POSIX message queues. Overview of POSIX message queues Archived 2025-08-06 at the Wayback Machine at linux.die.net
  5. ^ Using Linux Message Queues. Linux message queue functions Archived 2025-08-06 at the Wayback Machine at www.civilized.com
  6. ^ For example, the MSMQ product. "Message Queuing (MSMQ)". Network Communication. Microsoft Developer Network. Retrieved May 9, 2009.
  7. ^ Bach, M.J. (1986). The Design of the UNIX Operating System. Prentice-Hall. ISBN 9780132017992.
  8. ^ Abraham Silberschatz, Peter B. Galvin (1994). Operating Systems Concepts. Addison-Wesley. ISBN 9780201504804.
  9. ^ Cartwright, Corky. "GUI Programming". Rice University:Robert (Corky) Cartwright. Retrieved June 27, 2020.
  10. ^ Nystrom, Robert (2014). Game Programming Patterns. Genever Benning. ISBN 978-0990582908. Retrieved June 27, 2020.
三加一是什么意思 可是什么意思 早上口干苦是什么原因 骨量减少是什么意思 甲亢有什么反应
猿人头是什么牌子 敖包是什么意思 魈是什么意思 下午4点半是什么时辰 ace是什么意思
为什么生日不能提前过 血糖高喝什么茶 避孕套和安全套有什么区别 母亲吃什么退婴儿黄疸 花斑癣用什么药膏
生理盐水有什么用 头痛吃什么药 中午十一点是什么时辰 月经病是什么意思啊 坐月子能吃什么蔬菜
刘禅属什么生肖hcv8jop9ns4r.cn 封闭抗体是什么意思hcv8jop5ns5r.cn 肚子不舒服是什么原因hcv7jop7ns2r.cn 绝代双骄是什么意思hcv9jop3ns4r.cn 负离子有什么作用hcv9jop0ns6r.cn
肌酐低是什么原因hcv7jop9ns8r.cn 牙齿痛用什么药hcv9jop6ns3r.cn 地球什么时候毁灭hcv9jop1ns1r.cn 女性尿道炎吃什么药hcv9jop2ns4r.cn 本科什么意思hcv9jop6ns9r.cn
铁低的原因是什么hcv7jop9ns0r.cn 肌酐高什么东西不能吃hcv8jop0ns9r.cn 口子念什么hcv7jop9ns8r.cn ct是什么bfb118.com 什么茶养胃又治胃病hcv9jop0ns7r.cn
落是什么生肖hcv9jop2ns6r.cn 长沙有什么区hcv9jop7ns2r.cn 什么的风儿hcv8jop1ns2r.cn 什么药降肌酐最快最好hcv7jop4ns6r.cn 属猴与什么属相最配hcv9jop7ns3r.cn
百度