Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Resources calling method in multiline range process

A multi-threading and resource technology, applied in the direction of resource allocation, multi-programming device, etc., can solve problems such as increasing system load, errors, conflicts, etc., to reduce system workload, reduce system load, and achieve simple effects

Active Publication Date: 2006-06-28
BEIJING KINGSOFT OFFICE SOFTWARE INC
View PDF0 Cites 17 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Since multiple threads are run as independent tasks, when multiple threads operate on the same resource, the following problems will occur: at the same time, thread A wants to read a file, and thread B wants to read this file Write operation, then there will be conflicts and unpredictable errors
[0006] It can be seen from the above technical solution that a so-called deadlock will occur in the prior art, specifically: thread A needs to use shared resource 1 and shared resource 2 to complete an operation, and thread B also needs to use shared resource 1 and shared resource 2 to complete an operation One operation; and, the current thread A owns the lock for processing shared resource 1, applies for the lock of shared resource 2, and thread B owns the lock for processing shared resource 2, applies for the lock of shared resource 1, then thread A and thread B at this time Both wait for the other party to release the resource called, so that neither thread A nor thread B can complete the operation, and wait forever
In addition, creating a lock for each shared resource and performing lock / unlock operations will increase the system load, especially when the number of shared resources is large, the resource management and processing work of the system will be very cumbersome

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
  • Resources calling method in multiline range process
  • Resources calling method in multiline range process

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0017] The invention provides a resource call mechanism in multi-thread processing, especially for solving the problem of deadlock that is easy to occur when multi-thread calls shared resources in the prior art. The shared resources refer to resources processed by multiple threads, including: files, shared memory, registry and so on.

[0018] The core idea of ​​the present invention is: put the operation of the thread on the resource into the preset thread; generate a message when the thread applies for the resource call, and put it into the message queue of the preset thread; send the message according to the queue management mechanism, and trigger the operation of the thread on the resource .

[0019] Step 11: put the operation on the shared resource in each thread into a preset thread; the preset thread described in this embodiment is the message queue of the main thread created by the Windows system for the application program, or the Windows system for the application Th...

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

A method for calling on resource in multi-liner ¿C program processing includes placing operation of linear ¿C program on resource in pre-liner ¿C program, generating message when resource call ¿C on is requested by linear ¿C program and placing it in message queue of pre-liner ¿C program, triggering out operation of linear ¿C program on resource by transmitting message according to queue management mechanism.

Description

technical field [0001] The invention relates to a multi-thread processing mechanism, in particular to a resource calling method in multi-thread processing. Background technique [0002] A thread is a collection of instructions, or a special segment of a program, that can be executed independently in a program and is responsible for performing multiple tasks in a single program. Each program has a main thread, and according to needs, create multiple sub-threads outside the main thread to complete some auxiliary tasks. [0003] The multi-thread processing is to make multiple threads work in parallel to complete multiple tasks, so as to improve the efficiency of the system. A multi-threaded application divides the program into independent tasks. For tasks that are not currently being processed, the processor time is given to other tasks. For example: when thread A uses an input and output device to read a certain resource, the CPU is in an idle state. At this point, thread B ...

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 Applications(China)
IPC IPC(8): G06F9/50G06F9/46
Inventor 付黎
Owner BEIJING KINGSOFT OFFICE SOFTWARE INC
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products