康熙叫什么名字| 男人割了皮包什么样子| 痛经是什么原因引起的| 若无其事的若是什么意思| 蝴蝶什么意思| 遗精是什么症状| 肺部ct能查出什么病| 农历七月初六是什么星座| 劝君更尽一杯酒的下一句是什么| 吾日三省吾身是什么意思| g50是什么高速| 股癣用什么药膏好得快| 什么而不舍| 什么水果含维生素d| 七月初七是什么节| 冷得直什么| 喜悦之情溢于言表什么意思| 办理暂住证需要什么材料| app有什么用途| 三月六日是什么星座| 做梦梦见拉屎是什么意思| 修为是什么意思| 结膜炎滴什么眼药水| 柠檬和什么不能一起吃| 胆囊息肉不能吃什么| 什么症状要查心肌酶| 野猫吃什么| 水逆是什么意思| 罗汉果泡水喝有什么作用| 学前教育学什么| 泡泡什么意思| 鱼和熊掌不可兼得什么意思| 吃什么可以提高代谢| 好雅兴是什么意思| 酪蛋白是什么| 淋巴发炎挂什么科| 骨折喝酒有什么影响吗| 三点水者念什么意思| 舌头麻木是什么征兆| 尼维达手表什么档次| 胃泌素17是什么检查| 早上6点是什么时辰| 红细胞压积是什么意思| 什么是卵泡期| 帝陀表什么档次| 石棉是什么| 孕妇缺碘对胎儿有什么影响| 排骨炖苦瓜有什么功效| 来例假不能吃什么东西| 恶性循环是什么意思| 桑葚泡酒有什么功效| 三有动物是什么意思| 历法是什么意思| 热量的单位是什么| 奶水不足吃什么下奶多| 小米手机最新款是什么型号| 马粟是什么| 道地是什么意思| 龙和什么生肖最配| 子宫内膜病变有什么症状| 强五行属什么| diptyque属于什么档次| 6月22号是什么星座| 铁锈红配什么颜色好看| 肠结核是什么病| 血小板低会出现什么症状| 女性喝什么茶最好| 繁衍的衍是什么意思| 慢性前列腺炎吃什么药| ccu病房什么意思| 海誓山盟是什么意思| 益母草煮鸡蛋有什么功效| 一什么鸟窝| 加鸡腿什么意思| 小孩小便红色是什么原因| 为什么最迷人的最危险是什么歌| 妲己是什么意思| 72年五行属什么| 车厘子和樱桃什么区别| 什么是早恋| 痄腮是什么意思| 起死回生是什么生肖| 妮子什么意思| 申遗是什么意思| 上山下乡是什么意思| 指尖脱皮是什么原因| 正方体体积公式是什么| 词讼是什么意思| 开指是什么意思| 爱情的故事分分合合是什么歌| edd什么意思| 阿斯顿马丁什么档次| 破损是什么意思| 全身酸痛什么原因| 老佛爷是什么意思| 黔鱼是什么鱼| 卡介苗为什么会留疤| 苦瓜不能和什么一起吃| 3月7号什么星座| 传教士是什么意思| 畸形是什么意思| 中风吃什么药最有效| 高温丝假发是什么材质| 眼尖什么意思| emoji什么意思| 香港说什么语言| 云南白药草长什么样| 左侧头皮发麻是什么原因| 骨髓纤维化是什么病| 伏羲女娲是什么关系| 阳起石是什么东西| 吃什么补心| 胸闷气短是什么原因造成的| 抗性糊精是什么| 复合维生素是什么| 茱萸是什么| 谁与争锋是什么意思| 白细胞满视野是什么意思| 广州机场叫什么名字| 宵夜吃什么好| 4月8号什么星座| 什么水果好吃| 锁骨窝疼可能是什么病| hla医学上是什么意思| 米为什么会生虫| 五条杠什么牌子| 电饭煲煮粥为什么会溢出来| mrcp是什么检查| 什么盐比较好| 男孩取什么名字好听又有贵气| 激素是什么东西| 肾造瘘是什么意思| 为什么同房会痛| 青岛有什么玩的| 8023什么意思| 空气净化器有什么作用| 为什么尽量抽混合型烟| 痱子粉什么牌子好| xxoo是什么| 牛肉和什么菜包饺子好吃| 角化异常性疾病是什么| ckd3期是什么意思| 含羞草为什么会害羞| 榴莲不能和什么水果一起吃| 埋怨是什么意思| 甲状腺结节对身体有什么影响| 百年好合是什么意思| abcd是什么意思| 哈西奈德溶液治什么病| 什么可以醒酒| 维生素e的功效与作用是什么| 为什么老是做噩梦| 医生为什么穿白大褂| 什么叫能量| 什么属于轻微糖尿病| 便秘吃什么有用| 非萎缩性胃窦炎是什么意思| 寓是什么意思| 连翘败毒丸的功效与作用是什么| 珍珠五行属什么| 1月19号是什么星座| 遂什么意思| 尿酸高有什么症状表现| 啫啫是什么意思| 蜜枣是什么枣做的| 什么药治便秘最好最快| 促甲状腺激素偏低是什么意思| 鲤鱼吃什么| 胃酸胃烧心吃什么药| 正连级相当于地方什么级别| 反应蛋白偏高说明什么| 吃四方是什么生肖| 麻小是什么意思| 老睡不着觉是什么原因| 猪肝不能和什么一起吃| 难缠是什么意思| 三伏天是什么时候开始| 脾胃气滞吃什么中成药| 出圈是什么意思| 脑血管堵塞吃什么药| 中规中矩什么意思| 抗ccp抗体高说明什么| 油性头发用什么洗发水| 梦到自己孩子死了是什么征兆| 梦见打死狗有什么预兆| 湿疹为什么晚上特别痒| 蚂蚁上树什么姿势| 不排卵是什么原因造成| 抑郁吃什么药| 5月25号是什么星座| 左肩膀疼痛是什么原因| 上海为什么叫申城| 吃什么能生精和提高精子质量| 属猪本命佛是什么佛| hbsag阴性是什么意思| 诺贝尔奖为什么没有数学奖| 蝙蝠属于什么动物| 木瓜吃了有什么好处| 蛋疼是什么原因引起的| 生育酚是什么| hg是什么元素| 甲状腺功能减退是什么意思| 11月23日是什么星座| 免疫是什么意思| 早上起床眼屎多是什么原因| 下午右眼跳是什么预兆| 5月12日什么星座| 胎儿颈部可见u型压迹什么意思| blazer是什么意思啊| 宫内感染有什么症状| 戴银镯子对身体有什么好处| 无话不谈是什么意思| 月朔是什么意思| 沙悟净是什么生肖| 一个雨一个亏念什么| 紫外线过敏用什么药膏| 什么是遗精| 子宫内膜炎有什么症状| 孕早期吃什么好| 黄痰黄鼻涕吃什么药| 7月6日什么星座| 仓鼠可以吃什么蔬菜| 考试用什么笔| 当归不能和什么一起吃| 屁臭是什么原因造成的| 孙膑是什么学派| 做梦梦到自己生病了是什么意思| 11月2日什么星座| 内分泌失调吃什么药| 红苋菜不能和什么一起吃| 尿频尿急尿不尽吃什么药最快见效| 虫草花不能和什么一起吃| c3是什么意思| 老炮是什么意思| 默念是什么意思| 小孩贫血有什么症状| 身份证复印件是什么| 什么是中位数| 痛风吃什么药止痛最快| 颈椎病挂什么科最好| 爸爸的姥姥叫什么| 什么叫稽留流产| 烟头属于什么垃圾| 夹生饭是什么意思| mint什么颜色| 302是什么意思| 8月8是什么星座| 身体上有小红点是什么病| 气虚吃什么| 吃菠萝蜜有什么好处| 晚上吃什么最健康| 孕酮是什么| 早搏有什么症状| 钾离子低的原因是什么| 囊肿是什么病严重吗| 消化功能紊乱吃什么药| 什么手机性价比高| 昌字五行属什么| 人力资源是什么意思| 不典型血管瘤什么意思| 头出虚汗是什么原因引起的| 彩虹旗是什么意思| 月经粉红色是什么原因| 儿童咳嗽挂什么科| 百度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.
肌酐低什么原因 拉稀拉水吃什么药管用 一直流口水是什么原因 c是什么牌子 幽门螺旋杆菌用什么药治疗
早早孕是什么意思 嘴巴旁边长痘痘是为什么 冰心的原名叫什么 什么的照射 4五行属什么
元旦送什么礼物好 7月24日是什么星座 茶叶蛋用什么茶叶最好 1983属什么 炫是什么意思
坐飞机需要什么证件 17号来月经什么时候是排卵期 宫颈钙化灶是什么意思 干红是什么意思 良字少一点是什么字
头皮发红是什么原因jasonfriends.com 人艰不拆是什么意思yanzhenzixun.com 抗ccp抗体高说明什么hcv7jop5ns6r.cn 变蛋吃多了有什么危害hcv8jop8ns2r.cn 屈髋是什么姿势zhongyiyatai.com
菩提根是什么材质hcv9jop1ns9r.cn 朱砂是什么东西hcv9jop5ns2r.cn 画是什么结构hcv9jop1ns3r.cn 什么补肾效果最好hcv9jop1ns7r.cn 猪油用什么容器装好hcv8jop9ns9r.cn
比目鱼又叫什么鱼hcv8jop1ns9r.cn 红细胞数目偏高是什么意思weuuu.com 经期头疼吃什么药效果最好hcv8jop8ns8r.cn 96120是什么电话chuanglingweilai.com 鸭胗是鸭的什么部位hcv9jop3ns3r.cn
卵圆孔未闭是什么意思hcv7jop5ns2r.cn 血压高看什么科hcv8jop2ns3r.cn 梦到绿色的蛇是什么意思cj623037.com 眩晕症是什么原因引起的hcv7jop7ns4r.cn 尿微量白蛋白高是什么原因hcv9jop2ns7r.cn
百度