A multi-object blocking method and system thereof

A multi-object and queue technology, applied in the field of computer software applications, can solve the problem that threads cannot process pending tasks in time, and achieve the effect of reducing difficulty and simple implementation method

Active Publication Date: 2019-10-11
SHENZHEN YIHUA COMP +2
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The embodiment of the present invention provides a multi-object blocking method, which aims to solve the problem that in the existing method, when multiple queues in a single thread receive task processing messages at the same time, the thread cannot process the task to be processed in time

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A multi-object blocking method and system thereof
  • A multi-object blocking method and system thereof

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0020] figure 1 A flow chart of a multi-object blocking method provided by the first embodiment of the present invention is shown, and the details are as follows:

[0021] Step S110, the system sends the task to be processed to the queue, and calls the pre-registered notification function on the queue;

[0022] A thread in a blocked state in the operating system can only wait for one pending task. When a pending task is received on a queue, the thread is awakened to process the pending task on the queue, and cannot continue to wait for other queues; However, a single thread often needs to be blocked in the semaphore and task queue or multiple task queues at the same time. When the thread receives a synchronization signal or a pending task, it needs to process the signal or pending task immediately.

[0023] Therefore, in this step, when the system calls the queue for task processing, it first calls a notification function with a function notification function preset on the qu...

Embodiment 2

[0036] figure 2 A structural diagram of a multi-object blocking system provided by the second embodiment of the present invention is shown, and the system can be applied to various terminals. For ease of description, only parts related to the embodiments of the present invention are shown. The details are as follows:

[0037] The multi-object blocking system includes: a function calling unit 210 , a notification function 220 , and a thread 230 . in:

[0038] A function calling unit 210, configured to send tasks to be processed to a queue, and call a pre-registered notification function on the queue;

[0039]When calling the queue for task processing, first call a notification function with function notification function preset on the queue. For example, through the function: yh_semaphore_send_notify(&sem1, notify_function), register a notification function notify_function to the semaphore sem1, and this notification function can be triggered when the user uses the functio...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The present invention is applied to the field of computer software applications, and provides a multi-object blocking method and a system thereof. The method comprises that: the system sends a to-be-processed task to a queue, and invokes a pre-registered notification function on the queue, wherein the notification function sends a message to a pre-set gateway on a wake-up thread, and the thread determines a record value on the queue and executes the to-be-processed task according to the determination result. According to the method provided by the present invention, by setting gateway on the thread, the thread can wait for multiple queues simultaneously, and when there are to-be-processed tasks on all the queues, the to-be-processed tasks can be processed timely; and in embodiments of the present invention, the gateway is set on the thread to implement blocking on multi-objects, the method is simple, and the software design difficulty is greatly reduced.

Description

technical field [0001] The embodiments of the present invention belong to the field of computer software applications, and in particular relate to a multi-object blocking method and system thereof. Background technique [0002] Thread blocking usually means that a thread is suspended during execution to wait for a certain condition to trigger. When a thread is in the blocked state, the scheduler will ignore the thread and will not allocate any CPU time to the thread until the thread re-enters the ready state, it may perform operations. In the existing software system, there are threads in multiple queues. Although any queue can wake up the thread when it receives a task processing message, the thread can only wait for the appearance of a task to be processed on one of the queues, that is, one of the queues When the queue receives pending tasks and wakes up the thread, the thread no longer waits for other queues. For a certain thread, it often needs to be blocked in semapho...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/54G06F8/20
Inventor 李意希
Owner SHENZHEN YIHUA COMP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products