CN109542632A - A kind of method and device handling access request - Google Patents
A kind of method and device handling access request Download PDFInfo
- Publication number
- CN109542632A CN109542632A CN201811450600.2A CN201811450600A CN109542632A CN 109542632 A CN109542632 A CN 109542632A CN 201811450600 A CN201811450600 A CN 201811450600A CN 109542632 A CN109542632 A CN 109542632A
- Authority
- CN
- China
- Prior art keywords
- thread
- access request
- task execution
- created
- single thread
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/524—Deadlock detection or avoidance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of methods for handling access request, comprising: access request thread is orderly put into the queue for the first in first out that one is pre-created;The task execution single thread being pre-created is taken out the access request thread from the queue and is executed.Also disclose a kind of device for handling access request.This programme can give full play to the technical advantage of single thread, solve the difficult point concurrently locked.
Description
Technical field
The present invention relates to field of computer technology, espespecially a kind of method and device for handling access request.
Background technique
With the development of technology, the demand of business, the dominant frequency Step wise approximation limit of monokaryon CPU, multiple nuclear CPU framework become
A kind of inevitable technological trend, and Large-Scale Interconnected net flow is increasing, data traffic is surprising, the website of millions scale or is
It unites more and more, there is an urgent need to multi-core parallel concurrent calculating, and Multi-Client Concurrency Access becomes industry problem, are handling this problem
On, high concurrent problem is all solved in the form of lock substantially, and inefficiency, thread disorder, safety are often brought using lock
Property cannot be guaranteed.
Summary of the invention
In order to solve the above-mentioned technical problems, the present invention provides a kind of method and device for handling access request, Neng Gouchong
The technical advantage of single thread is waved in distribution, solves the difficult point concurrently locked.
In order to reach the object of the invention, the present invention provides a kind of methods for handling access request, comprising:
Access request thread is orderly put into the queue for the first in first out that one is pre-created;
The task execution single thread being pre-created is taken out the access request thread from the queue and is executed.
Further, the task execution single thread being pre-created takes out the access request thread from the queue
During being executed, comprising:
After the monitoring thread being pre-created monitors specified requirements, new task execution single thread is waken up to execute the visit
Ask request thread.
Further, the task execution single thread being pre-created takes out the access request thread from the queue
During being executed, comprising:
The task that the monitoring thread monitors in the queue is fully completed, then instruct the task execution single thread into
Enter suspend mode.
Further, the specified requirements includes:
The task execution single thread is not carried out one access request thread of completion more than specified time or the task is held
It malfunctions in row single thread implementation procedure.
Further, the specified requirements includes:
There is mistake in the task execution single thread.
A kind of device handling access request, comprising: memory and processor;Wherein:
The memory, for saving the program for handling access request;
The processor executes the program for being used to handle access request for reading, performs the following operations:
Access request thread is orderly put into the queue for the first in first out that one is pre-created;
The task execution single thread being pre-created is taken out the access request thread from the queue and is executed.
Further, the task execution single thread being pre-created takes out the access request thread from the queue
During being executed, comprising:
After the monitoring thread being pre-created monitors specified requirements, new task execution single thread is waken up to execute the visit
Ask request thread.
Further, the task execution single thread being pre-created takes out the access request thread from the queue
During being executed, comprising:
The task that the monitoring thread monitors in the queue is fully completed, then instruct the task execution single thread into
Enter suspend mode.
Further, the specified requirements includes:
The task execution single thread is more than to be not carried out specified time to complete an access request thread.
Further, the specified requirements includes:
There is mistake in the task execution single thread.
The multithreading of the method for the present embodiment, high concurrent is converted into single thread by way of queue, to evade more
Thread locks, multithreading deadlock locks the problem of performance cost of exclusive reference.The method of the embodiment of the present invention gives full play to
The technical advantage of single thread solves the difficult point concurrently locked, to achieve the effect that no lock, raising efficiency is efficiently executed.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification
It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right
Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this
The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is a kind of flow chart of the method for processing access request of the embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of the device of processing access request of the embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention
Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application
Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions
It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable
Sequence executes shown or described step.
Fig. 1 is a kind of flow chart of the method for processing access request of the embodiment of the present invention, as shown in Figure 1, the present embodiment
Method may include:
Step 101, the queue that access request thread is orderly put into the first in first out that one is pre-created;
Step 102, the task execution single thread being pre-created are taken out the access request thread from the queue and are carried out
It executes.
The multithreading of the method for the present embodiment, high concurrent is converted into single thread by way of queue, to evade more
Thread locks, multithreading deadlock locks the problem of performance cost of exclusive reference, and the method for the present embodiment is ingenious to use single line
Cheng Ze is without having to worry about these problems.
In one embodiment, the task execution single thread being pre-created takes out the access request from the queue
During thread is executed, can also include:
After the monitoring thread being pre-created monitors specified requirements, new task execution single thread is waken up to execute the visit
Ask request thread, and old task single thread is then destroyed.
Here specified requirements may include following any case, be certainly not limited to this:
It monitors the task execution single thread and is not carried out one access request thread of completion more than specified time;Or
There is mistake in the task execution single thread.
Such as occur network congestion cause task single thread be constantly in waiting and time-out or occur input and output (IO)
It is abnormal etc., it can all cause to malfunction.
Monitoring thread can monitor the executive condition of access request thread in real time, adjust task execution list according to the actual situation
The running of thread, for example, waking up single thread, monitor task thread implementation procedure and the result of creation task execution, destroying task
Single thread.
In one embodiment, the task execution single thread being pre-created takes out the access request from the queue
During thread is executed, can also include:
The task that the monitoring thread monitors in the queue is fully completed, then instruct the task execution single thread into
Enter suspend mode.Resource can be discharged in this way, save resource.
The method of the embodiment of the present invention gives full play to the technical advantage of single thread, the difficult point concurrently locked is solved, to reach
Effect without lock, raising efficiency efficiently execute.
Fig. 2 is a kind of schematic diagram of the device of processing access request of the embodiment of the present invention, as shown in Fig. 2, the present embodiment
Device include: memory and processor, wherein
The memory, for saving the program for handling access request;
The processor executes the program for being used to handle access request for reading, performs the following operations:
Access request thread is orderly put into the queue for the first in first out that one is pre-created;
The task execution single thread being pre-created is taken out the access request thread from the queue and is executed.
In one embodiment, the task execution single thread being pre-created takes out the access request from the queue
During thread is executed, may include:
After the monitoring thread being pre-created monitors specified requirements, new task execution single thread is waken up to execute the visit
Ask request thread.
In one embodiment, the task execution single thread being pre-created takes out the access request from the queue
During thread is executed, comprising:
The task that the monitoring thread monitors in the queue is fully completed, then instruct the task execution single thread into
Enter suspend mode.
In one embodiment, the specified requirements includes:
The task execution single thread is more than to be not carried out specified time to complete an access request thread.
In one embodiment, the specified requirements includes:
There is mistake in the task execution single thread.
The embodiment of the invention also provides a kind of computer readable storage mediums, are stored with computer executable instructions,
The computer executable instructions are performed the method for realizing the processing access request.
It will appreciated by the skilled person that whole or certain steps, system, dress in method disclosed hereinabove
Functional module/unit in setting may be implemented as software, firmware, hardware and its combination appropriate.In hardware embodiment,
Division between the functional module/unit referred in the above description not necessarily corresponds to the division of physical assemblies;For example, one
Physical assemblies can have multiple functions or a function or step and can be executed by several physical assemblies cooperations.Certain groups
Part or all components may be implemented as by processor, such as the software that digital signal processor or microprocessor execute, or by
It is embodied as hardware, or is implemented as integrated circuit, such as specific integrated circuit.Such software can be distributed in computer-readable
On medium, computer-readable medium may include computer storage medium (or non-transitory medium) and communication media (or temporarily
Property medium).As known to a person of ordinary skill in the art, term computer storage medium is included in for storing information (such as
Computer readable instructions, data structure, program module or other data) any method or technique in the volatibility implemented and non-
Volatibility, removable and nonremovable medium.Computer storage medium include but is not limited to RAM, ROM, EEPROM, flash memory or its
His memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storages, magnetic holder, tape, disk storage or other
Magnetic memory apparatus or any other medium that can be used for storing desired information and can be accessed by a computer.This
Outside, known to a person of ordinary skill in the art to be, communication media generally comprises computer readable instructions, data structure, program mould
Other data in the modulated data signal of block or such as carrier wave or other transmission mechanisms etc, and may include any information
Delivery media.
Claims (10)
1. a kind of method for handling access request characterized by comprising
Access request thread is orderly put into the queue for the first in first out that one is pre-created;
The task execution single thread being pre-created is taken out the access request thread from the queue and is executed.
2. the method according to claim 1, wherein the task execution single thread being pre-created is from the team
It is taken out in column during the access request thread executed, comprising:
After the monitoring thread being pre-created monitors specified requirements, wakes up new task execution single thread and asked to execute the access
Seek thread.
3. according to the method described in claim 2, it is characterized in that, the task execution single thread being pre-created is from the team
It is taken out in column during the access request thread executed, comprising:
The task that the monitoring thread monitors in the queue is fully completed, then instructs the task execution single thread to enter and stop
It sleeps.
4. according to the described in any item methods of Claims 2 or 3, which is characterized in that the specified requirements includes:
The task execution single thread is more than to be not carried out specified time to complete an access request thread or the task execution list
It malfunctions in thread implementation procedure.
5. according to the described in any item methods of Claims 2 or 3, which is characterized in that the specified requirements includes:
There is mistake in the task execution single thread.
6. a kind of device for handling access request, comprising: memory and processor;It is characterized by:
The memory, for saving the program for handling access request;
The processor executes the program for being used to handle access request for reading, performs the following operations:
Access request thread is orderly put into the queue for the first in first out that one is pre-created;
The task execution single thread being pre-created is taken out the access request thread from the queue and is executed.
7. device according to claim 6, which is characterized in that the task execution single thread being pre-created is from the team
It is taken out in column during the access request thread executed, comprising:
After the monitoring thread being pre-created monitors specified requirements, wakes up new task execution single thread and asked to execute the access
Seek thread.
8. device according to claim 7, which is characterized in that the task execution single thread being pre-created is from the team
It is taken out in column during the access request thread executed, comprising:
The task that the monitoring thread monitors in the queue is fully completed, then instructs the task execution single thread to enter and stop
It sleeps.
9. according to the described in any item devices of claim 6-8, which is characterized in that the specified requirements includes:
The task execution single thread is more than to be not carried out specified time to complete an access request thread.
10. according to the described in any item devices of claim 6-8, which is characterized in that the specified requirements includes:
There is mistake in the task execution single thread.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811450600.2A CN109542632A (en) | 2018-11-30 | 2018-11-30 | A kind of method and device handling access request |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811450600.2A CN109542632A (en) | 2018-11-30 | 2018-11-30 | A kind of method and device handling access request |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109542632A true CN109542632A (en) | 2019-03-29 |
Family
ID=65852168
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811450600.2A Pending CN109542632A (en) | 2018-11-30 | 2018-11-30 | A kind of method and device handling access request |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109542632A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110166730A (en) * | 2019-06-06 | 2019-08-23 | 苏州科达科技股份有限公司 | A kind of request processing method, device, equipment and readable storage medium storing program for executing |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103092746A (en) * | 2013-02-05 | 2013-05-08 | 上海大唐移动通信设备有限公司 | Positioning method and system for thread anomaly |
CN103902361A (en) * | 2014-04-04 | 2014-07-02 | 浪潮电子信息产业股份有限公司 | Thread pool capable of dynamically adjusting size |
US20150040140A1 (en) * | 2013-08-01 | 2015-02-05 | International Business Machines Corporation | Consuming Ordered Streams of Messages in a Message Oriented Middleware |
CN105302527A (en) * | 2015-10-29 | 2016-02-03 | 华北电力大学 | Thread organization method |
CN106547612A (en) * | 2016-10-18 | 2017-03-29 | 深圳怡化电脑股份有限公司 | A kind of multi-task processing method and device |
CN106919441A (en) * | 2017-02-08 | 2017-07-04 | 武汉奇米网络科技有限公司 | A kind of processing method and system of e-commerce platform high concurrent event |
CN108415806A (en) * | 2018-02-07 | 2018-08-17 | 深圳市亿联智能有限公司 | A kind of high efficiency thread life monitoring mode |
-
2018
- 2018-11-30 CN CN201811450600.2A patent/CN109542632A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103092746A (en) * | 2013-02-05 | 2013-05-08 | 上海大唐移动通信设备有限公司 | Positioning method and system for thread anomaly |
US20150040140A1 (en) * | 2013-08-01 | 2015-02-05 | International Business Machines Corporation | Consuming Ordered Streams of Messages in a Message Oriented Middleware |
CN103902361A (en) * | 2014-04-04 | 2014-07-02 | 浪潮电子信息产业股份有限公司 | Thread pool capable of dynamically adjusting size |
CN105302527A (en) * | 2015-10-29 | 2016-02-03 | 华北电力大学 | Thread organization method |
CN106547612A (en) * | 2016-10-18 | 2017-03-29 | 深圳怡化电脑股份有限公司 | A kind of multi-task processing method and device |
CN106919441A (en) * | 2017-02-08 | 2017-07-04 | 武汉奇米网络科技有限公司 | A kind of processing method and system of e-commerce platform high concurrent event |
CN108415806A (en) * | 2018-02-07 | 2018-08-17 | 深圳市亿联智能有限公司 | A kind of high efficiency thread life monitoring mode |
Non-Patent Citations (2)
Title |
---|
何清法: "《国产神通数据库教程》", 30 September 2012 * |
王洪香: "《JAVA程序设计案例教程》", 31 August 2007 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110166730A (en) * | 2019-06-06 | 2019-08-23 | 苏州科达科技股份有限公司 | A kind of request processing method, device, equipment and readable storage medium storing program for executing |
CN110166730B (en) * | 2019-06-06 | 2021-08-27 | 苏州科达科技股份有限公司 | Request processing method, device, equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109271450B (en) | Database synchronization method, device, server and storage medium | |
US10453010B2 (en) | Computer device, method, and apparatus for scheduling business flow | |
US9501502B2 (en) | Locking protocol for partitioned and distributed tables | |
US9152474B2 (en) | Context aware synchronization using context and input parameter objects associated with a mutual exclusion lock | |
US11016805B2 (en) | Programmatically applying labels to nodes in cluster orchestration platforms | |
US10621143B2 (en) | Methods and systems of a dedupe file-system garbage collection | |
US10540524B2 (en) | Memory access protection using processor transactional memory support | |
US8973117B2 (en) | Propagating security identity information to components of a composite application | |
WO2019148728A1 (en) | Electronic device, execution task assignment method for distributed system, and storage medium | |
CN104503989B (en) | A method of it completing heterogeneous database and collects | |
US8484341B2 (en) | Organizing individual java client request flows into a single server transaction | |
US20170199704A1 (en) | System for providing a time-limited mutual exclusivity lock and method therefor | |
US20140108839A1 (en) | Log record writing system, device, method, and program | |
CN109542632A (en) | A kind of method and device handling access request | |
US11307780B2 (en) | Cluster group change preparation techniques | |
US20130018861A1 (en) | Dual locking mechanism for a domain | |
US9910893B2 (en) | Failover and resume when using ordered sequences in a multi-instance database environment | |
US20060288049A1 (en) | Method, System and computer Program for Concurrent File Update | |
US9430338B2 (en) | Method and computing device for recording log entries | |
US20160140149A1 (en) | Dynamic modification of database schema | |
EP2509008A2 (en) | Database management system enhancements | |
US11271992B2 (en) | Lazy lock queue reduction for cluster group changes | |
US10834021B1 (en) | Dynamic management of concurrent access to shared computing resources | |
US20160210320A1 (en) | Log acquisition management program, log acquisition management device, and log acquisition management method | |
CN109358970A (en) | A kind of method of cloud data center task management and task center |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190329 |
|
RJ01 | Rejection of invention patent application after publication |