Unlock instant, AI-driven research and patent intelligence for your innovation.

A method and device for acquiring thread synchronization resources

A resource and thread technology, applied in the field of thread synchronization resource acquisition, can solve problems such as large system operation, risk, and no record and monitoring of resource allocation, and achieve the effect of reducing operation risk and improving flexibility

Active Publication Date: 2019-07-30
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF10 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] To sum up, the existing technology uses random or based on the length of waiting time to wake up the blocked thread for multiple threads to call the same resource, which cannot meet the requirements for resource calls similar to threads with priority, so not only It will cause the problem that the thread cannot be executed in time because the resources cannot be obtained in time, and even cause a greater risk to the operation of the entire system; at the same time, the existing technology does not record and monitor the allocation of all current resources, which will also make future There is no basis for analyzing whether the program thread resource design is reasonable

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 method and device for acquiring thread synchronization resources
  • A method and device for acquiring thread synchronization resources
  • A method and device for acquiring thread synchronization resources

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0035] Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

[0036] figure 1 is a schematic diagram of an apparatus for acquiring thread synchronization resources according to an embodiment of the present invention. The device 10 for obtaining thread synchronization resources in the embodiment of the present invention mainly includes: a receiving module 11, a determining module 12, and a first providing module 13; the receiving mod...

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 invention provides an acquisition method and device for thread synchronization resources, aiming at meeting the similar requirements of resource calling of threads with priority levels, avoiding the problems that the threads cannot be executed in time as the resources cannot be acquired in time, and reducing the operation risks of a whole system to a certain extent. Meanwhile, distribution conditions of all resources at present are recorded and monitored, and data evidences are provided for analyzing whether a program thread resource design is reasonable or not in the future. The acquisition method for the thread synchronization resources comprises the following steps: receiving acquired resource parameters sent by the threads; determining weight values of the threads according to weight parameters; according to the resource parameters, determining whether the resources are in a locked state or not; under the precondition that the resources are determined to be in the locked state, modifying the state of the threads into a blocked state; putting the threads into a waiting queue of the resources; under the condition that the resources are unlocked, providing the resources to the thread with the greatest weight value in the waiting queue.

Description

technical field [0001] The invention relates to the technical field of computers and software thereof, in particular to a method and device for acquiring thread synchronization resources. Background technique [0002] In java programs, concurrency based on multithreading is very common. In order to prevent data damage caused by multi-threaded access to the same resource (data object), synchronization (lock) is used to ensure that each resource can only be accessed by one thread at a certain time, while other threads can only block ;Wake up the blocked thread after waiting for other threads to complete. [0003] Since the blocking and waking up of threads are random, for threads with high priority, if resources cannot be obtained for a long time, the thread will not be able to execute in time, and even cause a greater risk to the entire system. In the existing jvm virtual machine, the processing method for multiple threads calling the same resource generally adopts a fair l...

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/46G06F9/48G06F9/52G06F9/50G06F11/34
CPCG06F9/468G06F9/4881G06F9/5005G06F9/52G06F11/3442G06F2209/483G06F2209/484G06F2209/5013G06F2209/5021G06F2209/508
Inventor 魏亚文孙政
Owner BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD