Lock-free message queue implementation method
A technology of message queue and implementation method, applied in the field of lock-free message queue implementation, can solve problems such as performance loss, achieve the effects of improving performance, reducing the danger of program deadlock, and simplifying code debugging work
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0017] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention.
[0018] The invention provides a lock-free message queue implementation method, such as figure 1 As shown, use the producer dispatching message mode to change the original consumer obtaining message mode. The methods include:
[0019] S1: The main thread obtains the message, and saves the message in the message queue;
[0020] The main thread is the producer, and the message is sent externally.
[0021] S2: The main thread detects whether all worker threads have idle worker threads; if not, continue to detect all worker threads until an idle worker thread is detected, then jump to step S3; if yes, then jump to step S3;
[0022] The worker thread is the consumer.
[0023] S3: the main thread sends the message to an idle worker thread, the idle worker thread receives the mess...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com