摘要 |
The invention is applicable in the technical field of message processing, and provides a method and a device for processing messages in a shared queue and a receiving core. The method comprises the following steps: an interrupt handler in the receiving core receiving an interrupt notification message transmitted by the shared queue; the interrupt handler reading a reserved message number; the interrupt handler judging the read reserved message number; if the reserved message number is 0, messages having been occupied by other receiving core, a service thread being not awakened, and the interrupt handler directly exiting; if the reserved message number is non-0, messages being reserved successfully, the service thread being awakened, and the service thread reading the messages from the shared queue. The invention avoids awakening of invalid service threads when a plurality of receiving cores share a queue so as to reduce time delay, and the service thread can process the messages of a fixed number more than 1 under a shared queue message processing scenario of multiple receiving ends. |