The invention discloses an implementation method for highly concurrent message queues. The method comprises the steps of creating a
doubly linked list of an FIFO (First Input First Output) as a globalmessage
queue, and a
message queue thread corresponding to the global
message queue; creating a global
thread pool, wherein the global
thread pool is provided with a certain amount of work threads and
data source job linked lists; enabling the
message queue thread to detect that messages exist in the global message
queue, sequentially taking out each message from an egress of the global message
queue to generate jobs, inserting the jobs into the
data source job
linked list of the global
thread pool, and then
broadcasting the work threads; and enabling different work threads of the global thread
pool to respectively take out one job from the
data source job
linked list, executing
callback functions of the corresponding messages according to types of the jobs to perform corresponding business
processing, and respectively returning
processing results to corresponding clients after completion of the execution. According to the implementation method for the highly concurrent message queues, a relatively large
data request concurrent amount can be borne; after pushing the messages to the message queues, a
consumer does not need to wait for return results; the response speed is improved;and the consumption of
system resources is reduced.