WO2019052576A1 - Synchrolock-based multi-thread processing method, terminal and storage medium - Google Patents

Synchrolock-based multi-thread processing method, terminal and storage medium Download PDF

Info

Publication number
WO2019052576A1
WO2019052576A1 PCT/CN2018/106215 CN2018106215W WO2019052576A1 WO 2019052576 A1 WO2019052576 A1 WO 2019052576A1 CN 2018106215 W CN2018106215 W CN 2018106215W WO 2019052576 A1 WO2019052576 A1 WO 2019052576A1
Authority
WO
WIPO (PCT)
Prior art keywords
thread
access
same data
data resource
write
Prior art date
Application number
PCT/CN2018/106215
Other languages
French (fr)
Chinese (zh)
Inventor
涂斌健
陈东持
Original Assignee
惠州Tcl移动通信有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 惠州Tcl移动通信有限公司 filed Critical 惠州Tcl移动通信有限公司
Publication of WO2019052576A1 publication Critical patent/WO2019052576A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/524Deadlock detection or avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation

Definitions

  • the present invention relates to the field of intelligent terminal technologies, and in particular, to a synchronization lock based multi-thread processing method, a terminal, and a storage medium.
  • processor vendors have been limited by power consumption and temperature, and in order to keep high-performance computing growing, computers have moved toward multicore computer architectures.
  • the application is split into multiple threads that can run independently on a single CPU, so that the design program can be executed in parallel to improve overall operational efficiency.
  • security problems are prone to occur. For example, multithreading is problematic in that data is inconsistent or inaccurate when the same data is manipulated.
  • the synchronization mechanism is generally used to control access of multiple threads to the same data resource, so that when multiple threads access the same data resource at the same time, the same data resource is guaranteed to be exclusively occupied by one thread at a time.
  • the blocking time is too long, and even the jamming and the application are unresponsive.
  • the technical problem to be solved by the present invention is to provide a multi-thread processing method based on a synchronization lock, a terminal, and a storage medium, in order to solve the problem that the existing multi-thread accessing the same data resource has a long clogging time. problem.
  • a synchronization lock based multi-thread processing method comprising:
  • the multi-threads are sorted according to the access time, and the preset synchronization locks are sequentially accessed according to the sorting;
  • the access permission includes a read access right and a write access right
  • the cascode-based multi-thread processing method wherein the multi-thread processing method further includes:
  • the first thread does not have write access rights, detecting whether the same data resource is in a state accessed by the first write access thread;
  • the first thread thread sleep state is controlled when there is a second write access thread.
  • the cascode-based multi-thread processing method wherein the multi-thread processing method further includes:
  • the first thread is the same as the first write access thread, configuring read access rights for the first thread, and controlling the first thread to access the same data resource, and the first thread
  • the number of visits is increased by one;
  • the cascode-based multi-thread processing method wherein the multi-thread processing method further includes:
  • the cascode-based multi-thread processing method wherein the multi-thread processing method further includes:
  • the first thread is controlled to enter a wait state.
  • the cascode-based multi-thread processing method wherein the multi-thread processing method further includes:
  • the type of the second thread is a write access thread, detecting whether the first thread is the same as the second thread;
  • first thread is the same as the second thread, configure write access rights for the first thread, and control the thread to access the same data resource, and increase the number of accesses of the thread by one;
  • the cascode-based multi-thread processing method wherein the multi-thread processing method further includes:
  • the third thread is a read access thread/write access thread, detecting whether the third thread has read access/write access rights, and acquiring the third when it has read access/write access rights The number of accesses corresponding to the thread;
  • the thread When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up;
  • the number of accesses is greater than 1, the number of accesses is decremented by one and the thread in the dormant state is woken up.
  • a storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform a synchronization lock based multi-thread processing method as described above.
  • a mobile terminal includes:
  • a storage device adapted to store a plurality of instructions adapted to be loaded by the processor and to perform a synchronization lock based multi-thread processing method as described above.
  • the present invention provides a synchronization lock based multi-thread processing method, a terminal, and a storage medium, the multi-thread processing method including: when a multi-thread accesses the same data resource, the The multi-threads are sorted according to the access time, and sequentially access the preset synchronization locks according to the sorting; the synchronization lock controls the thread having the write permission to access the same data resource separately, and the continuous multi-thread with the read permission simultaneously accesses the same data Resources.
  • the invention sets the access authority for the multi-thread by the synchronization lock, and accesses the same data resource separately for the thread with the write permission, and can access the same data resource for the consecutive multiple threads with the read access right, so that the multi-thread accesses the same data resource is satisfied.
  • the security requirements can increase the processing speed of multi-threading and reduce the blocking time of multi-threading.
  • FIG. 1 is a flowchart of a preferred embodiment of a synchronization lock based multi-thread processing method provided by the present invention.
  • FIG. 2 is a schematic structural diagram of a preferred embodiment of a terminal provided by the present invention.
  • the present invention provides a multi-thread processing method based on a genlock, a terminal, and a storage medium.
  • the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
  • FIG. 1 is a flowchart of a preferred embodiment of a synchronization lock based multi-thread processing method according to the present invention.
  • the multi-thread processing method includes:
  • the embodiment provides a synchronization lock-based multi-thread processing method, when multiple threads are accessed by the same data resource, the multiple thread case access times are sorted, and the preset synchronization locks are sequentially accessed according to the sorting order; Controlling, by the synchronization lock, the access mode of each thread, for a thread having write permission, accessing when the same data resource is not accessed by other threads; for a thread having read permission, the same data resource is being Read access threads access or access by other threads, that is, multiple consecutive read access threads can access the same data resource at the same time. Since the read access does not modify the same data resource, multiple read access threads access the same data at the same time. Resources do not create data inconsistencies or inaccuracies, and at the same time reduce the thread's waiting time, thus solving the problem of thread blocking.
  • the data is initiated by different clients or applications based on the HTTP protocol.
  • the resource access request that is, the presence of at most access threads (recorded as multi-threaded) for the same data resource
  • the upper-layer application receives the multi-threaded access to the same data resource.
  • the threads of the same data resource received by the upper layer application are sorted.
  • the sorting can be directly ordered on different engine access agents that request data resources from the underlying storage engine, or the access requests on different engine access agents can be routed to an engine access agent for sorting.
  • the embodiment of the present invention preferably routes access requests on different engine access agents to an engine access agent for sorting, so that when the concurrent access requests are sorted, no state query is required between different engine access agents.
  • the access mode of the thread is controlled by the synchronization lock, in the access mode, for a thread having write permission (a thread that performs modification or write operation on the same data resource) Accessing the same data resource; for a thread having a read permission (a thread that performs a read operation on the same data resource), a plurality of consecutive threads (threads in a consecutive position after sorting) simultaneously access the same data resource.
  • the concentric lock configures access rights for threads, and controls access of the thread to the same data resource according to the access rights configured for the thread and the access manner corresponding to the access rights, wherein the access rights include read access rights and write access rights.
  • controlling, by the synchronization lock, the thread having the write permission to access the same data resource separately, and the consecutive multi-threads having the read permission simultaneously accessing the same data resource may include:
  • the first thread when the first thread needs to obtain the access authority, the first thread needs the synchronization lock for the configuration, and a read access permission and a write access permission are preset in the synchronization lock. That is, it is detected whether the first thread acquires read access rights or write access rights in the synchronization lock.
  • the write access permission of the synchronous lock configuration can be acquired by only one thread at a time; the read access right can be acquired by multiple threads at the same time. That is to say, only one thread at each time in the multi-thread accessing the same data resource can have write access rights, that is, two threads cannot have write access at the same time. In a multi-thread that accesses the same data resource, there may be multiple threads having write access rights at the same time.
  • step S102 When the first thread needs to obtain read access permission, detect whether the first thread has write access authority. If yes, execute step S103. If not, perform step 104.
  • the first thread After determining that the first thread acquires the read access right, it is detected whether the first thread has write access permission to determine whether the same data resource is accessed by another thread having write permission.
  • the first thread has write access permission, and no other thread having write access rights enters the same data resource by using the synchronization lock.
  • the read access authority is configured for the first thread, and is controlled. The first thread accesses the same data resource.
  • step S104 If the first thread does not have the write access right, detect whether the same data resource is in the access state of the first write access thread. If yes, execute step S108. If not, execute step S105.
  • the first thread when the first thread does not have write access rights, it indicates that the same data resource may be accessed by a write access thread having write access rights; thus, it is required to detect whether the same data resource is in the first write access thread. Access status.
  • step S105 If the first write access thread is not in the access state, detect whether there is a second write access thread in the wait state. If yes, execute step S107. If not, execute step S106.
  • the not being accessed by the first write access thread indicates that the same data resource is in an idle state or is accessed by a read access thread. Since the first thread does not have the write access right, the thread may acquire the write access right and wait in the state, so that it is necessary to detect whether there is a second write access thread in the waiting state, so that the first thread can avoid the same data resource.
  • the order of access is different from the order of access to the sync lock, and the second write access thread that is waiting is waiting for a long time, or is always in a wait state, thereby applying the feedback speed of the second write access thread, and even failing to feed back. In addition, this also ensures that multiple read access rights to access the same data resource are continuous in access time, and the symbol synchronization lock is set to access mode.
  • the first thread is a continuous thread.
  • the first thread when there is a second write access thread, the first thread is not configured to configure read access rights, and at the same time, it is controlled to enter a sleep state.
  • step S108 If it is in the access state of the first write access thread, determine whether the first thread and the first write access thread are the same; if they are the same, execute step S109, and if not, perform 110.
  • the number of accesses of the first thread is recorded, so that the thread is subsequently released according to the number of accesses.
  • controlling, by the synchronization lock, the thread having the write permission to access the same data resource separately, and the consecutive multi-threads having the read permission simultaneously accessing the same data resource may include:
  • step S202 when the first thread needs to obtain the write access right, it is detected whether the same data resource is in an idle state, if it is idle, step S203 is performed, if not idle, step S204 is performed;
  • step S204 when not in the idle state, determine the type of the second thread accessing the same data resource, if it is a read access thread, step S205 is performed, if the access thread is written, step 206 is performed;
  • step S206 if the type of the second thread is a write access thread, detecting whether the first thread is the same as the second thread; if the same, step S207 is performed, if not, step S208 is performed;
  • the third thread is a read access thread/write access thread, detecting whether the third thread has read access permission/write access permission, and acquiring the read permission/write access permission when the third thread has read access permission/write access permission. The number of accesses corresponding to the third thread;
  • the implementation performs the permission detection on the first thread before the third thread leaves the synchronization lock to enter the same data resource, and prompts the abnormality when it does not have the permission corresponding to the access operation to be performed, and has the need to perform the abnormality.
  • the access operation corresponds to the permission
  • the corresponding access times are detected. If the number of accesses is greater than 1, the number of accesses is reduced by one. If equal to 1, the third thread is removed from the cache, and the manual performs the current access operation. The third thread can be released.
  • the present invention also provides a storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform a synchronization lock based multi-thread processing method as described above.
  • the present invention also provides a terminal, as shown in FIG. 2, which includes at least one processor 20; a display screen 21; and a memory 22, which may further include a communication interface 23 and a bus 24. .
  • the processor 20, the display screen 21, the memory 22, and the communication interface 23 can complete communication with each other through the bus 24.
  • the display screen 21 is set to display a user guidance interface preset in the initial setting mode.
  • the communication interface 23 can transmit information.
  • the processor 20 can call the logic instructions in the memory 22 to perform the genlock-based multi-thread processing method in the above embodiment.
  • logic instructions in the memory 22 described above may be implemented in the form of software functional units and sold or used as separate products, and may be stored in a computer readable storage medium.
  • the memory 22 is a computer readable storage medium that can be configured to store a software program, a computer executable program, a program instruction or module corresponding to the genlock-based multi-thread processing method in the embodiment of the present disclosure.
  • the processor 30 executes the function application and the data processing by executing a software program, an instruction or a module stored in the memory 22, that is, the genlock-based multi-thread processing method in the above embodiment is implemented.
  • the memory 22 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the terminal device, and the like. Further, the memory 22 may include a high speed random access memory, and may also include a nonvolatile memory. For example, a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., may also be used to store a program code. State storage medium.

Abstract

A synchrolock-based multi-thread processing method, a terminal and a storage medium. The multi-thread processing method comprises: when multiple threads access the same data resource, ordering the multiple threads according to access time, and successively accessing a pre-set synchrolock according to the order (S10); and by means of the synchrolock, controlling a thread, having a write permission, to access the same data resource alone and continuous multiple threads, having a read permission, to simultaneously access the same data resource (S20). An access permission is set for multiple threads via a synchrolock; a thread having a write permission accesses the same data resource alone, and continuous multiple threads having a read access permission can simultaneously access the same data resource; as such, not only is the security requirement of multiple threads accessing the same data resource satisfied, but also the speed of multi-thread processing can be improved, reducing blockage time of multiple threads.

Description

一种基于同步锁的多线程处理方法、终端以及存储介质Multi-thread processing method based on synchronous lock, terminal and storage medium 技术领域Technical field
本发明涉及智能终端技术领域,特别涉及一种基于同步锁的多线程处理方法、终端以及存储介质。The present invention relates to the field of intelligent terminal technologies, and in particular, to a synchronization lock based multi-thread processing method, a terminal, and a storage medium.
背景技术Background technique
最近几年内,处理器厂商受到功耗和温度的限制,同时为了保持高性能运算持续增长,计算机已经朝着多核计算机体系架构方向发展。为了充分利用多核架构,应用程序被拆分成多个可独立运行在单个CPU上面的线程,这样设计程序可以并行执行提高整体运行效率。但是,当使用多个线程来访问同一数据时,容易出现安全问题,例如,多线程都在操作同一数据导致数据不一致或者不准确的问题等。In recent years, processor vendors have been limited by power consumption and temperature, and in order to keep high-performance computing growing, computers have moved toward multicore computer architectures. To take full advantage of the multi-core architecture, the application is split into multiple threads that can run independently on a single CPU, so that the design program can be executed in parallel to improve overall operational efficiency. However, when multiple threads are used to access the same data, security problems are prone to occur. For example, multithreading is problematic in that data is inconsistent or inaccurate when the same data is manipulated.
为了解决上述问题,目前普遍采用同步机制下控制多线程对同一数据资源的访问,以使得在多线程同时访问同一数据资源时,保证所述同一数据资源每次被一个线程独占。但是,当访问所述同一资源的多线程数量较大时,会导致阻塞时间过长,甚至卡顿、应用程序无响应的问题。In order to solve the above problem, the synchronization mechanism is generally used to control access of multiple threads to the same data resource, so that when multiple threads access the same data resource at the same time, the same data resource is guaranteed to be exclusively occupied by one thread at a time. However, when the number of multi-threads accessing the same resource is large, the blocking time is too long, and even the jamming and the application are unresponsive.
因而现有技术还有待改进和提高。Therefore, the prior art has yet to be improved and improved.
发明内容Summary of the invention
本发明要解决的技术问题在于,针对现有技术的不足,提供一种基于同步锁的多线程处理方法、终端以及存储介质,以解决现有多线程访问同一数据资源时存在的堵塞时间长的问题。The technical problem to be solved by the present invention is to provide a multi-thread processing method based on a synchronization lock, a terminal, and a storage medium, in order to solve the problem that the existing multi-thread accessing the same data resource has a long clogging time. problem.
为了解决上述技术问题,本发明所采用的技术方案如下:In order to solve the above technical problem, the technical solution adopted by the present invention is as follows:
一种基于同步锁的多线程处理方法,其包括:A synchronization lock based multi-thread processing method, comprising:
当多线程访问同一数据资源时,将所述多线程依照访问时间排序,并依照 排序依次访问预设的同步锁;When the multi-thread accesses the same data resource, the multi-threads are sorted according to the access time, and the preset synchronization locks are sequentially accessed according to the sorting;
当第一线程访问同步锁时,检测所述第一线程需要获取的访问权限,其中,所述访问权限包括读访问权限和写访问权限;When the first thread accesses the synchronization lock, detecting the access permission that the first thread needs to obtain, wherein the access permission includes a read access right and a write access right;
当所述第一线程需要获取读访问权限时,检测所述第一线程是否具有写访问权限;When the first thread needs to acquire read access rights, detecting whether the first thread has write access rights;
若所述第一线程具有写访问权限,则为所述第一线程配置读访问权限,并控制所述第一线程访问所述同一数据资源。If the first thread has write access rights, configure read access rights for the first thread, and control the first thread to access the same data resource.
所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The cascode-based multi-thread processing method, wherein the multi-thread processing method further includes:
若所述第一线程不具有写访问权限,则检测所述同一数据资源是否处于被第一写访问线程访问状态;If the first thread does not have write access rights, detecting whether the same data resource is in a state accessed by the first write access thread;
若所述同一数据资源未处于被第一写访问线程访问状态,则检测是否存在处于等待状态的第二写访问线程;If the same data resource is not in the access state by the first write access thread, detecting whether there is a second write access thread in the waiting state;
当不存在第二写访问线程时,为所述第一线程配置写访问权限,并控制所述第一线程访问所述同一数据资源;When the second write access thread does not exist, configuring write access rights for the first thread, and controlling the first thread to access the same data resource;
当存在第二写访问线程时,控制所述第一线程线程休眠状态。The first thread thread sleep state is controlled when there is a second write access thread.
所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The cascode-based multi-thread processing method, wherein the multi-thread processing method further includes:
若所述同一数据资源处于被第一写访问线程访问状态,则判断所述第一线程与所述第一写访问线程是否相同;If the same data resource is in the access state by the first write access thread, determining whether the first thread is the same as the first write access thread;
如果所述第一线程与所述第一写访问线程相同,则为所述第一线程配置读访问权限,并控制所述第一线程访问所述同一数据资源,以及将所述第一线程的访问次数加一;If the first thread is the same as the first write access thread, configuring read access rights for the first thread, and controlling the first thread to access the same data resource, and the first thread The number of visits is increased by one;
如果所述第一线程与所述第一写访问线程不相同,则控制所述第一线程进入休眠状态。If the first thread is different from the first write access thread, controlling the first thread to enter a sleep state.
所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The cascode-based multi-thread processing method, wherein the multi-thread processing method further includes:
当所述第一线程需要获取写访问权限时,检测所述同一数据资源是否处于空闲状态;When the first thread needs to obtain write access rights, detecting whether the same data resource is in an idle state;
当所述同一数据资源处于空闲状态时,为所述第一线程配置写访问权限,并控制所述第一线程访问所述同一数据资源。When the same data resource is in an idle state, configuring write access rights for the first thread and controlling the first thread to access the same data resource.
所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The cascode-based multi-thread processing method, wherein the multi-thread processing method further includes:
当所述同一数据资源未处于空闲状态时,判断访问所述同一数据资源的第二线程的类型,其中,所述类型包括读访问线程和写访问线程;Determining, when the same data resource is not in an idle state, a type of a second thread accessing the same data resource, where the type includes a read access thread and a write access thread;
若所述第二线程的类型为读访问线程,则控制所述第一线程进入等待状态。If the type of the second thread is a read access thread, the first thread is controlled to enter a wait state.
所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The cascode-based multi-thread processing method, wherein the multi-thread processing method further includes:
若所述第二线程的类型为写访问线程,则检测所述第一线程与所述第二线程是否相同;If the type of the second thread is a write access thread, detecting whether the first thread is the same as the second thread;
若所述第一线程与所述第二线程相同,则为所述第一线程配置写访问权限,并控制所述线程访问所述同一数据资源,以及将所述线程的访问次数加一;If the first thread is the same as the second thread, configure write access rights for the first thread, and control the thread to access the same data resource, and increase the number of accesses of the thread by one;
若所述第一线程与所述第二线程不相同,则控制所述第一线程进入等待状态。If the first thread is different from the second thread, controlling the first thread to enter a waiting state.
所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The cascode-based multi-thread processing method, wherein the multi-thread processing method further includes:
当访问所述同一资源的第三线程离开时,判断所述第三线程的访问类型;Determining an access type of the third thread when a third thread accessing the same resource leaves;
若所述第三线程为读访问线程/写访问线程时,则检测所述第三线程是否具有读访问权限/写访问权限,并在其具有读访问权限/写访问权限时获取所述第三线程对应的访问次数;If the third thread is a read access thread/write access thread, detecting whether the third thread has read access/write access rights, and acquiring the third when it has read access/write access rights The number of accesses corresponding to the thread;
当所述访问次数为1时,将所述线程移除缓存,并唤醒处于休眠状态的线程;When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up;
当所述访问次数大于1时,将所述访问次数减一,并唤醒处于休眠状态的 线程。When the number of accesses is greater than 1, the number of accesses is decremented by one and the thread in the dormant state is woken up.
一种存储介质,其存储有多条指令,所述指令适于由处理器加载并执行如上任一所述的基于同步锁的多线程处理方法。A storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform a synchronization lock based multi-thread processing method as described above.
一种移动终端,其包括:A mobile terminal includes:
处理器,适于实现各指令;以及a processor adapted to implement each instruction;
存储设备,适于存储多条指令,所述指令适于由处理器加载并执行如上任一所述的基于同步锁的多线程处理方法。A storage device adapted to store a plurality of instructions adapted to be loaded by the processor and to perform a synchronization lock based multi-thread processing method as described above.
有益效果:与现有技术相比,本发明提供了一种基于同步锁的多线程处理方法、终端以及存储介质,所述多线程处理方法包括:当多线程访问同一数据资源时,将所述多线程依照访问时间排序,并依照排序依次访问预设的同步锁;通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源。本发明通过同步锁为多线程设置访问权限,对于具有写权限的线程单独访问同一数据资源,对于具有读访问权限的连续多个线程可以同时访问同一数据资源,这样既满足多线程访问同一数据资源的安全性要求,又可以提高多线程的处理速度,减少了多线程的堵塞时间。Advantageous Effects: Compared with the prior art, the present invention provides a synchronization lock based multi-thread processing method, a terminal, and a storage medium, the multi-thread processing method including: when a multi-thread accesses the same data resource, the The multi-threads are sorted according to the access time, and sequentially access the preset synchronization locks according to the sorting; the synchronization lock controls the thread having the write permission to access the same data resource separately, and the continuous multi-thread with the read permission simultaneously accesses the same data Resources. The invention sets the access authority for the multi-thread by the synchronization lock, and accesses the same data resource separately for the thread with the write permission, and can access the same data resource for the consecutive multiple threads with the read access right, so that the multi-thread accesses the same data resource is satisfied. The security requirements can increase the processing speed of multi-threading and reduce the blocking time of multi-threading.
附图说明DRAWINGS
图1为本发明提供的基于同步锁的多线程处理方法较佳实施例的流程图。FIG. 1 is a flowchart of a preferred embodiment of a synchronization lock based multi-thread processing method provided by the present invention.
图2为本发明提供的终端较佳实施例的结构原理图。2 is a schematic structural diagram of a preferred embodiment of a terminal provided by the present invention.
具体实施方式Detailed ways
本发明提供一种基于同步锁的多线程处理方法、终端以及存储介质,为使本发明的目的、技术方案及效果更加清楚、明确,以下参照附图并举实施例对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。The present invention provides a multi-thread processing method based on a genlock, a terminal, and a storage medium. The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是, 本发明的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。应该理解,当我们称元件被“连接”或“耦接”到另一元件时,它可以直接连接或耦接到其他元件,或者也可以存在中间元件。此外,这里使用的“连接”或“耦接”可以包括无线连接或无线耦接。这里使用的措辞“和/或”包括一个或更多个相关联的列出项的全部或任一单元和全部组合。The singular forms "a", "an", "the" It is to be understood that the phrase "comprise" or "an" or "an" Integers, steps, operations, components, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element. Further, "connected" or "coupled" as used herein may include either a wireless connection or a wireless coupling. The phrase "and/or" used herein includes all or any one and all combinations of one or more of the associated listed.
本技术领域技术人员可以理解,除非另外定义,这里使用的所有术语(包括技术术语和科学术语),具有与本发明所属领域中的普通技术人员的一般理解相同的意义。还应该理解的是,诸如通用字典中定义的那些术语,应该被理解为具有与现有技术的上下文中的意义一致的意义,并且除非像这里一样被特定定义,否则不会用理想化或过于正式的含义来解释。Those skilled in the art will appreciate that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the invention belongs, unless otherwise defined. It should also be understood that terms such as those defined in a general dictionary should be understood to have meaning consistent with the meaning in the context of the prior art, and will not be idealized or excessive unless specifically defined as here. The formal meaning is explained.
下面结合附图,通过对实施例的描述,对发明内容作进一步说明。The contents of the invention will be further described by the following description of embodiments with reference to the accompanying drawings.
请参照图1,图1为本发明提供的基于同步锁的多线程处理方法的较佳实施例的流程图。所述多线程处理方法包括:Please refer to FIG. 1. FIG. 1 is a flowchart of a preferred embodiment of a synchronization lock based multi-thread processing method according to the present invention. The multi-thread processing method includes:
S10、当多线程访问同一数据资源时,将所述多线程依照访问时间排序,并依照排序依次访问预设的同步锁;S10. When multiple threads access the same data resource, the multiple threads are sorted according to the access time, and the preset synchronization locks are sequentially accessed according to the sorting;
S20、通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源。S20. Control, by the synchronization lock, that the thread having the write permission separately accesses the same data resource, and the continuous multi-thread with the read permission simultaneously accesses the same data resource.
本实施例提供了一种基于同步锁的多线程处理方法,在同一数据资源接收到多个线程访问时,将多个线程案子访问时间排序,并依照排序顺序依次访问预设的同步锁;并且通过所述同步锁控制每个线程的访问方式,对于具有写权限的线程,在所述同一数据资源未被其他线程访问时进行访问;对于具有读权限的线程,在所述同一数据资源正在被读访问线程进行访问或者未被其他线程访问时进行访问,即多个连续读访问线程可以同时访问同一数据资源,由于读访问未对同一数据资源进行修改,从而多个读访问线程同时访问同一数据资源不会产生数据不一致或者不准确的问题,同时又可以减少线程的等待时间,进而解决了线程阻塞的问题。The embodiment provides a synchronization lock-based multi-thread processing method, when multiple threads are accessed by the same data resource, the multiple thread case access times are sorted, and the preset synchronization locks are sequentially accessed according to the sorting order; Controlling, by the synchronization lock, the access mode of each thread, for a thread having write permission, accessing when the same data resource is not accessed by other threads; for a thread having read permission, the same data resource is being Read access threads access or access by other threads, that is, multiple consecutive read access threads can access the same data resource at the same time. Since the read access does not modify the same data resource, multiple read access threads access the same data at the same time. Resources do not create data inconsistencies or inaccuracies, and at the same time reduce the thread's waiting time, thus solving the problem of thread blocking.
具体的来说,在所述步骤S10中,对于存在热点访问的数据资源,在基于底层分布式存储引擎架设的对象存储系统中,会由基于HTTP协议的不同客户端或者应用程序发起对该数据资源的访问请求,即对同一数据资源存在至多访问线程(记为多线程),上层应用接收该对同一数据资源的多线程访问。而在上层应用接收到对同一数据的多线程时,对上层应用接收到的同一数据资源的对线程进行排序。此外,所述排序可以在对底层存储引擎请求数据资源的不同引擎访问代理上直接进行排序,也可将不同引擎访问代理上的访问请求路由到一个引擎访问代理上进行排序。本发明实施例优选将不同引擎访问代理上的访问请求路由到一个引擎访问代理上进行排序,使得在对并发访问请求进行排序时,无需不同引擎访问代理之间进行状态查询。Specifically, in the step S10, for the data resource with hotspot access, in the object storage system based on the underlying distributed storage engine, the data is initiated by different clients or applications based on the HTTP protocol. The resource access request, that is, the presence of at most access threads (recorded as multi-threaded) for the same data resource, the upper-layer application receives the multi-threaded access to the same data resource. When the upper layer application receives the multithreading of the same data, the threads of the same data resource received by the upper layer application are sorted. In addition, the sorting can be directly ordered on different engine access agents that request data resources from the underlying storage engine, or the access requests on different engine access agents can be routed to an engine access agent for sorting. The embodiment of the present invention preferably routes access requests on different engine access agents to an engine access agent for sorting, so that when the concurrent access requests are sorted, no state query is required between different engine access agents.
进一步,在所述步骤S20中,通过所述同步锁控制线程的访问方式,在所述访问方式中,对于具有写权限的线程(对所述同一数据资源进行修改或者写入操作的线程)单独访问所述同一数据资源;对于具有读权限线程(对所述同一数据资源进行读取操作的线程)多个连续线程(排序后处于连续位置的线程)同时访问所述同一数据资源。此外,所述同心锁为线程配置访问权限,并依据其为线程配置的访问权限以及访问权限对应的访问方式来控制线程对同一数据资源的访问,其中,访问权限包括读访问权限和写访问权限。Further, in the step S20, the access mode of the thread is controlled by the synchronization lock, in the access mode, for a thread having write permission (a thread that performs modification or write operation on the same data resource) Accessing the same data resource; for a thread having a read permission (a thread that performs a read operation on the same data resource), a plurality of consecutive threads (threads in a consecutive position after sorting) simultaneously access the same data resource. In addition, the concentric lock configures access rights for threads, and controls access of the thread to the same data resource according to the access rights configured for the thread and the access manner corresponding to the access rights, wherein the access rights include read access rights and write access rights. .
实施例一Embodiment 1
本实施例将对上述实施例中涉及的同步锁控制多线程访问同一数据资源进行详细说明。此外,本实施例中对需要获取读访问权限并对同一数据资源进行读访问的线程的处理过程进行说明,其他对多线程的排序过程的处理步骤可参考如上所述实施例,在此不再赘述This embodiment will be described in detail with respect to the synchronization lock control multi-thread access to the same data resource involved in the above embodiment. In addition, in this embodiment, the processing procedure of a thread that needs to acquire read access rights and perform read access to the same data resource is described. Other processing steps of the multi-thread sorting process may refer to the foregoing embodiment, and no longer Narrative
在本实施例中,所述通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源具体可以包括:In this embodiment, the controlling, by the synchronization lock, the thread having the write permission to access the same data resource separately, and the consecutive multi-threads having the read permission simultaneously accessing the same data resource may include:
S101、当第一线程访问同步锁时,检测所述第一线程需要获取的访问权限,其中,所述访问权限包括读访问权限和写访问权限。S101. When the first thread accesses the synchronization lock, detecting the access permission that the first thread needs to acquire, where the access permission includes a read access right and a write access right.
具体地,所述第一线程需要获取的访问权限指的时所述第一线程需要同步 锁为其配置的访问权限,所述同步锁中预先设置了一个读访问权限和一个写访问权限。也就是说,检测所述第一线程要获取同步锁中的读访问权限还是写访问权限。此外,所述同步锁配置的写访问权限在同一时间仅一个线程可以获取;读访问权限在同一时间可以多个线程获取。也就是说,在访问所述同一数据资源的多线程中每一时刻仅有一个线程可以具有写访问权限,即不能两个线程同时具有写访问权限。在访问所述同一数据资源的多线程中可以有多线程同时具有写访问权限。Specifically, when the first thread needs to obtain the access authority, the first thread needs the synchronization lock for the configuration, and a read access permission and a write access permission are preset in the synchronization lock. That is, it is detected whether the first thread acquires read access rights or write access rights in the synchronization lock. In addition, the write access permission of the synchronous lock configuration can be acquired by only one thread at a time; the read access right can be acquired by multiple threads at the same time. That is to say, only one thread at each time in the multi-thread accessing the same data resource can have write access rights, that is, two threads cannot have write access at the same time. In a multi-thread that accesses the same data resource, there may be multiple threads having write access rights at the same time.
S102、当所述第一线程需要获取读访问权限时,检测所述第一线程是否具有写访问权限,若具有,执行步骤S103,若不具有,执行步骤104。S102. When the first thread needs to obtain read access permission, detect whether the first thread has write access authority. If yes, execute step S103. If not, perform step 104.
具体地,在确定第一线程要获取读访问权限后,检测所述第一线程是否已经具有写访问权限,以判断所述同一数据资源是否被其他具有写权限的线程访问。Specifically, after determining that the first thread acquires the read access right, it is detected whether the first thread has write access permission to determine whether the same data resource is accessed by another thread having write permission.
S103、若所述第一线程具有写访问权限,则为所述第一线程配置读访问权限,并控制所述第一线程访问所述同一数据资源。S103. If the first thread has write access rights, configure read access rights for the first thread, and control the first thread to access the same data resource.
具体地,所述第一线程具有写访问权限说明没有其他具有写访问权限的线程通过所述同步锁而进入所述同一数据资源,此时,为所述第一线程配置读访问权限,并控制所述第一线程访问所述同一数据资源。Specifically, the first thread has write access permission, and no other thread having write access rights enters the same data resource by using the synchronization lock. At this time, the read access authority is configured for the first thread, and is controlled. The first thread accesses the same data resource.
S104、若所述第一线程不具有写访问权限,则检测所述同一数据资源是否处于被第一写访问线程访问状态,若处于,则执行步骤S108,若未处于,则执行步骤S105。S104. If the first thread does not have the write access right, detect whether the same data resource is in the access state of the first write access thread. If yes, execute step S108. If not, execute step S105.
具体地,当所述第一线程不具有写访问权限时,说明同一数据资源可能处于被具有写访问权限的写访问线程在访问;从而需要检测所述同一数据资源是否处于被第一写访问线程访问状态。Specifically, when the first thread does not have write access rights, it indicates that the same data resource may be accessed by a write access thread having write access rights; thus, it is required to detect whether the same data resource is in the first write access thread. Access status.
S105、若未处于被第一写访问线程访问状态,则检测是否存在处于等待状态的第二写访问线程,若存在,则执行步骤S107,若未存在,则执行步骤S106。S105. If the first write access thread is not in the access state, detect whether there is a second write access thread in the wait state. If yes, execute step S107. If not, execute step S106.
具体地,所述未处于被第一写访问线程访问状态说明所述同一数据资源处于空闲状态或者被读访问线程访问状态。而由于第一线程不具有写访问权限, 则可能存在线程获取写访问权限并处于等待状态,从而需要检测是否存在处于等待状态的第二写访问线程,这样可以避免第一线程对同一数据资源的访问顺序与其进入同步锁的访问顺序不同,而导致处于等待的第二写访问线程处于等待的时间较长,或者一直处于等待状态,从而应用第二写访问线程的反馈速度,甚至无法反馈。此外,这样也保证了访问同一数据资源的多个读访问权限在访问时间上是连续的,符号同步锁设置的访问方式。Specifically, the not being accessed by the first write access thread indicates that the same data resource is in an idle state or is accessed by a read access thread. Since the first thread does not have the write access right, the thread may acquire the write access right and wait in the state, so that it is necessary to detect whether there is a second write access thread in the waiting state, so that the first thread can avoid the same data resource. The order of access is different from the order of access to the sync lock, and the second write access thread that is waiting is waiting for a long time, or is always in a wait state, thereby applying the feedback speed of the second write access thread, and even failing to feed back. In addition, this also ensures that multiple read access rights to access the same data resource are continuous in access time, and the symbol synchronization lock is set to access mode.
S106、当未存在第二写访问线程时,为所述第一线程配置写访问权限,并控制所述第一线程访问所述同一数据资源。S106. When the second write access thread does not exist, configure write access rights for the first thread, and control the first thread to access the same data resource.
具体地,未存在第二写访问线程,说明所述同一数据资源处于空闲状态或者被读访问线程访问状态,并且若同一数据资源被读访问线程访问,访问所述同一数据资源的读访问线程与第一线程为连续线程。Specifically, there is no second write access thread, indicating that the same data resource is in an idle state or is accessed by a read access thread, and if the same data resource is accessed by the read access thread, the read access thread accessing the same data resource is The first thread is a continuous thread.
S107、当存在第二写访问线程时,控制所述第一线程线程休眠状态。S107. Control the first thread thread to sleep state when there is a second write access thread.
具体地,当存在第二写访问线程时,则不未所述第一线程配置读访问权限,同时控制其进入休眠状态。Specifically, when there is a second write access thread, the first thread is not configured to configure read access rights, and at the same time, it is controlled to enter a sleep state.
S108、若处于被第一写访问线程访问状态,则判断所述第一线程与所述第一写访问线程是否相同;若相同,执行步骤S109,若不相同,执行110。S108. If it is in the access state of the first write access thread, determine whether the first thread and the first write access thread are the same; if they are the same, execute step S109, and if not, perform 110.
S109、如果相同,则为所述第一线程配置读访问权限,并控制所述第一线程访问所述同一数据资源,以及将所述第一线程的访问次数加一。S109. If the same, configure read access rights for the first thread, and control the first thread to access the same data resource, and increase the number of accesses of the first thread by one.
具体地,记录所述第一线程的访问次数,以便于后续根据所述访问次数释放所述线程。Specifically, the number of accesses of the first thread is recorded, so that the thread is subsequently released according to the number of accesses.
S110、如果不相同,则控制所述第一线程进入休眠状态。S110. If not, control the first thread to enter a sleep state.
实施例二Embodiment 2
本实施例中将对需要获取写访问权限并对同一数据资源进行读访问的线程的处理过程进行说明,其他对多线程的排序过程的处理步骤以及读权限的处理步骤可参考如上所述实施例,在此不再赘述。In this embodiment, the processing procedure of the thread that needs to acquire the write access right and read access to the same data resource will be described. Other processing steps of the multi-thread sorting process and the processing steps of the read permission may refer to the embodiment as described above. , will not repeat them here.
在本实施例中,所述通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源具体可以包括:In this embodiment, the controlling, by the synchronization lock, the thread having the write permission to access the same data resource separately, and the consecutive multi-threads having the read permission simultaneously accessing the same data resource may include:
S201、当第一线程访问同步锁时,检测所述第一线程需要获取的访问权限,其中,所述访问权限包括读访问权限和写访问权限。S201. When the first thread accesses the synchronization lock, detecting the access permission that the first thread needs to obtain, where the access permission includes a read access right and a write access right.
S202、当所述第一线程需要获取写访问权限时,检测所述同一数据资源是否处于空闲状态,若处于空闲,执行步骤S203,若未处于空闲,执行步骤S204;S202, when the first thread needs to obtain the write access right, it is detected whether the same data resource is in an idle state, if it is idle, step S203 is performed, if not idle, step S204 is performed;
S203、当处于空闲状态时,为所述第一线程配置写访问权限,并控制所述第一线程访问所述同一数据资源;S203. When in an idle state, configure write access rights for the first thread, and control the first thread to access the same data resource.
S204、当未处于空闲状态时,判断访问所述同一数据资源的第二线程的类型,若为读访问线程,执行步骤S205,若写访问线程,执行步骤206;S204, when not in the idle state, determine the type of the second thread accessing the same data resource, if it is a read access thread, step S205 is performed, if the access thread is written, step 206 is performed;
S205、若所述第二线程的类型为读访问线程,则控制所述第一线程进入等待状态;S205. If the type of the second thread is a read access thread, control the first thread to enter a waiting state.
S206、若所述第二线程的类型为写访问线程,则检测所述第一线程与所述第二线程是否相同;若相同,执行步骤S207,若不相同,执行步骤S208;S206, if the type of the second thread is a write access thread, detecting whether the first thread is the same as the second thread; if the same, step S207 is performed, if not, step S208 is performed;
S207、若相同,则为所述第一线程配置写访问权限,并控制所述线程访问所述同一数据资源,以及将所述线程的访问次数加一;S207. If the same, configure write access rights for the first thread, and control the thread to access the same data resource, and increase the number of accesses of the thread by one;
S208、若不相同,则控制所述第一线程进入等待状态。S208. If not, control the first thread to enter a waiting state.
本实施例根据同一资源的访问状态确定是否为第一线程配置写访问权限,以控制所述第一线程对所述同一数据资源进行访问,实现了写访问进程仅能单独访问所述同一数据资源,避免了由于写访问请求对同一数据资源的写入或修改,而影响数据的一致性。In this embodiment, it is determined whether the write access right is configured for the first thread according to the access status of the same resource, so as to control the first thread to access the same data resource, so that the write access process can only access the same data resource separately. , to avoid the write or modify of the same data resource due to the write access request, which affects the consistency of the data.
实施例三Embodiment 3
本实施例中将对线程离开同步锁的过程进行说明,其他对多线程的处理步骤可参考如上所述实施例,在此不再赘述。In the embodiment, the process of leaving the synchronization lock is described. For the other processing steps of the multi-thread, refer to the foregoing embodiment, and details are not described herein.
本实施例提供的基于同步锁的多线程处理方法,其还包括:The synchronization lock-based multi-thread processing method provided in this embodiment further includes:
S301、当访问所述同一资源的第三线程离开时,判断所述第三线程的访问类型;S301. Determine, when the third thread accessing the same resource leaves, the access type of the third thread.
S302、若所述第三线程为读访问线程/写访问线程时,则检测所述第三线程是否具有读访问权限/写访问权限,并在其具有读访问权限/写访问权限时获取所述第三线程对应的访问次数;S302. If the third thread is a read access thread/write access thread, detecting whether the third thread has read access permission/write access permission, and acquiring the read permission/write access permission when the third thread has read access permission/write access permission. The number of accesses corresponding to the third thread;
S303、当所述访问次数为1时,将所述线程移除缓存,并唤醒处于休眠状态的线程;S303. When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up.
S304、当所述访问次数大于1时,将所述访问次数减一,并唤醒处于休眠状态的线程。S304. When the number of accesses is greater than 1, the number of accesses is decremented by one, and the thread in the dormant state is woken up.
本实施通过在第三线程离开同步锁进入同一数据资源之前,对第一线程再做一次权限检测,并在其不具有其需进行的访问操作对应的权限时,提示异常,在具有其需进行的访问操作对应的权限时,检测其对应的访问次数,如果访问次数大于1,将将访问次数减一,如果等于1则将所述第三线程移除缓存,说明书执行完当前的访问操作即可以释放所述第三线程。The implementation performs the permission detection on the first thread before the third thread leaves the synchronization lock to enter the same data resource, and prompts the abnormality when it does not have the permission corresponding to the access operation to be performed, and has the need to perform the abnormality. When the access operation corresponds to the permission, the corresponding access times are detected. If the number of accesses is greater than 1, the number of accesses is reduced by one. If equal to 1, the third thread is removed from the cache, and the manual performs the current access operation. The third thread can be released.
本发明还提供了一种存储介质,其存储有多条指令,所述指令适于由处理器加载并执行如上任一所述的基于同步锁的多线程处理方法。The present invention also provides a storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform a synchronization lock based multi-thread processing method as described above.
本发明还提供了一种终端,如图2所示,其包括至少一个处理器(processor)20;显示屏21;以及存储器(memory)22,还可以包括通信接口(Communications Interface)23和总线24。其中,处理器20、显示屏21、存储器22和通信接口23可以通过总线24完成相互间的通信。显示屏21设置为显示初始设置模式中预设的用户引导界面。通信接口23可以传输信息。处理器20可以调用存储器22中的逻辑指令,以执行上述实施例中的基于同步锁的多线程处理方法。The present invention also provides a terminal, as shown in FIG. 2, which includes at least one processor 20; a display screen 21; and a memory 22, which may further include a communication interface 23 and a bus 24. . Among them, the processor 20, the display screen 21, the memory 22, and the communication interface 23 can complete communication with each other through the bus 24. The display screen 21 is set to display a user guidance interface preset in the initial setting mode. The communication interface 23 can transmit information. The processor 20 can call the logic instructions in the memory 22 to perform the genlock-based multi-thread processing method in the above embodiment.
此外,上述的存储器22中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。In addition, the logic instructions in the memory 22 described above may be implemented in the form of software functional units and sold or used as separate products, and may be stored in a computer readable storage medium.
存储器22作为一种计算机可读存储介质,可设置为存储软件程序、计算 机可执行程序,如本公开实施例中的基于同步锁的多线程处理方法对应的程序指令或模块。处理器30通过运行存储在存储器22中的软件程序、指令或模块,从而执行功能应用以及数据处理,即实现上述实施例中的基于同步锁的多线程处理方法。The memory 22 is a computer readable storage medium that can be configured to store a software program, a computer executable program, a program instruction or module corresponding to the genlock-based multi-thread processing method in the embodiment of the present disclosure. The processor 30 executes the function application and the data processing by executing a software program, an instruction or a module stored in the memory 22, that is, the genlock-based multi-thread processing method in the above embodiment is implemented.
存储器22可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器22可以包括高速随机存取存储器,还可以包括非易失性存储器。例如,U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The memory 22 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the terminal device, and the like. Further, the memory 22 may include a high speed random access memory, and may also include a nonvolatile memory. For example, a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., may also be used to store a program code. State storage medium.
此外,上述存储介质以及终端中的多条指令处理器加载并执行的具体过程在上述基于同步锁的多线程处理方法中已经详细说明,在这里就不再一一陈述。In addition, the above-described storage medium and the specific processes loaded and executed by the plurality of instruction processors in the terminal have been described in detail in the above-described genlock-based multi-thread processing method, and will not be further described herein.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not limited thereto; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that The technical solutions described in the foregoing embodiments are modified, or the equivalents of the technical features are replaced. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (20)

  1. 一种基于同步锁的多线程处理方法,其中,所述多线程处理方法包括:A synchronization lock based multi-thread processing method, wherein the multi-thread processing method comprises:
    当多线程访问同一数据资源时,将所述多线程依照访问时间排序,并依照排序依次访问预设的同步锁;When multiple threads access the same data resource, the multiple threads are sorted according to the access time, and the preset synchronization locks are sequentially accessed according to the sorting;
    当第一线程访问同步锁时,检测所述第一线程需要获取的访问权限,其中,所述访问权限包括读访问权限和写访问权限;When the first thread accesses the synchronization lock, detecting the access permission that the first thread needs to obtain, wherein the access permission includes a read access right and a write access right;
    当所述第一线程需要获取读访问权限时,检测所述第一线程是否具有写访问权限;When the first thread needs to acquire read access rights, detecting whether the first thread has write access rights;
    若所述第一线程具有写访问权限,则为所述第一线程配置读访问权限,并控制所述第一线程访问所述同一数据资源。If the first thread has write access rights, configure read access rights for the first thread, and control the first thread to access the same data resource.
  2. 根据权利要求1所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 1, wherein the multi-thread processing method further comprises:
    若所述第一线程不具有写访问权限,则检测所述同一数据资源是否处于被第一写访问线程访问状态;If the first thread does not have write access rights, detecting whether the same data resource is in a state accessed by the first write access thread;
    若所述同一数据资源未处于被第一写访问线程访问状态,则检测是否存在处于等待状态的第二写访问线程;If the same data resource is not in the access state by the first write access thread, detecting whether there is a second write access thread in the waiting state;
    当不存在第二写访问线程时,为所述第一线程配置写访问权限,并控制所述第一线程访问所述同一数据资源;When the second write access thread does not exist, configuring write access rights for the first thread, and controlling the first thread to access the same data resource;
    当存在第二写访问线程时,控制所述第一线程线程休眠状态。The first thread thread sleep state is controlled when there is a second write access thread.
  3. 根据权利要求2所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 2, wherein the multi-thread processing method further comprises:
    若所述同一数据资源处于被第一写访问线程访问状态,则判断所述第一线程与所述第一写访问线程是否相同;If the same data resource is in the access state by the first write access thread, determining whether the first thread is the same as the first write access thread;
    如果所述第一线程与所述第一写访问线程相同,则为所述第一线程配置读 访问权限,并控制所述第一线程访问所述同一数据资源,以及将所述第一线程的访问次数加一;If the first thread is the same as the first write access thread, configuring read access rights for the first thread, and controlling the first thread to access the same data resource, and the first thread The number of visits is increased by one;
    如果所述第一线程与所述第一写访问线程不相同,则控制所述第一线程进入休眠状态。If the first thread is different from the first write access thread, controlling the first thread to enter a sleep state.
  4. 根据权利要求1所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 1, wherein the multi-thread processing method further comprises:
    当所述第一线程需要获取写访问权限时,检测所述同一数据资源是否处于空闲状态;When the first thread needs to obtain write access rights, detecting whether the same data resource is in an idle state;
    当所述同一数据资源处于空闲状态时,为所述第一线程配置写访问权限,并控制所述第一线程访问所述同一数据资源。When the same data resource is in an idle state, configuring write access rights for the first thread and controlling the first thread to access the same data resource.
  5. 根据权利要求4所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 4, wherein the multi-thread processing method further comprises:
    当所述同一数据资源未处于空闲状态时,判断访问所述同一数据资源的第二线程的类型,其中,所述类型包括读访问线程和写访问线程;Determining, when the same data resource is not in an idle state, a type of a second thread accessing the same data resource, where the type includes a read access thread and a write access thread;
    若所述第二线程的类型为读访问线程,则控制所述第一线程进入等待状态。If the type of the second thread is a read access thread, the first thread is controlled to enter a wait state.
  6. 根据权利要求5所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 5, wherein the multi-thread processing method further comprises:
    若所述第二线程的类型为写访问线程,则检测所述第一线程与所述第二线程是否相同;If the type of the second thread is a write access thread, detecting whether the first thread is the same as the second thread;
    若所述第一线程与所述第二线程相同,则为所述第一线程配置写访问权限,并控制所述线程访问所述同一数据资源,以及将所述线程的访问次数加一;If the first thread is the same as the second thread, configure write access rights for the first thread, and control the thread to access the same data resource, and increase the number of accesses of the thread by one;
    若所述第一线程与所述第二线程不相同,则控制所述第一线程进入等待状态。If the first thread is different from the second thread, controlling the first thread to enter a waiting state.
  7. 根据权利要求1所述基于同步锁的多线程处理方法,其中,所述多线 程处理方法还包括:The multiplex lock processing method according to claim 1, wherein the multi-thread processing method further comprises:
    当访问所述同一资源的第三线程离开时,判断所述第三线程的访问类型;Determining an access type of the third thread when a third thread accessing the same resource leaves;
    若所述第三线程为读访问线程/写访问线程时,则检测所述第三线程是否具有读访问权限/写访问权限,并在其具有读访问权限/写访问权限时获取所述第三线程对应的访问次数;If the third thread is a read access thread/write access thread, detecting whether the third thread has read access/write access rights, and acquiring the third when it has read access/write access rights The number of accesses corresponding to the thread;
    当所述访问次数为1时,将所述线程移除缓存,并唤醒处于休眠状态的线程;When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up;
    当所述访问次数大于1时,将所述访问次数减一,并唤醒处于休眠状态的线程。When the number of accesses is greater than 1, the number of accesses is decremented by one, and the thread in the dormant state is woken up.
  8. 根据权利要求2所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 2, wherein the multi-thread processing method further comprises:
    当访问所述同一资源的第三线程离开时,判断所述第三线程的访问类型;Determining an access type of the third thread when a third thread accessing the same resource leaves;
    若所述第三线程为读访问线程/写访问线程时,则检测所述第三线程是否具有读访问权限/写访问权限,并在其具有读访问权限/写访问权限时获取所述第三线程对应的访问次数;If the third thread is a read access thread/write access thread, detecting whether the third thread has read access/write access rights, and acquiring the third when it has read access/write access rights The number of accesses corresponding to the thread;
    当所述访问次数为1时,将所述线程移除缓存,并唤醒处于休眠状态的线程;When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up;
    当所述访问次数大于1时,将所述访问次数减一,并唤醒处于休眠状态的线程。When the number of accesses is greater than 1, the number of accesses is decremented by one, and the thread in the dormant state is woken up.
  9. 根据权利要求3所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 3, wherein the multi-thread processing method further comprises:
    当访问所述同一资源的第三线程离开时,判断所述第三线程的访问类型;Determining an access type of the third thread when a third thread accessing the same resource leaves;
    若所述第三线程为读访问线程/写访问线程时,则检测所述第三线程是否具有读访问权限/写访问权限,并在其具有读访问权限/写访问权限时获取所述第三线程对应的访问次数;If the third thread is a read access thread/write access thread, detecting whether the third thread has read access/write access rights, and acquiring the third when it has read access/write access rights The number of accesses corresponding to the thread;
    当所述访问次数为1时,将所述线程移除缓存,并唤醒处于休眠状态的线程;When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up;
    当所述访问次数大于1时,将所述访问次数减一,并唤醒处于休眠状态的线程。When the number of accesses is greater than 1, the number of accesses is decremented by one, and the thread in the dormant state is woken up.
  10. 根据权利要求4所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 4, wherein the multi-thread processing method further comprises:
    当访问所述同一资源的第三线程离开时,判断所述第三线程的访问类型;Determining an access type of the third thread when a third thread accessing the same resource leaves;
    若所述第三线程为读访问线程/写访问线程时,则检测所述第三线程是否具有读访问权限/写访问权限,并在其具有读访问权限/写访问权限时获取所述第三线程对应的访问次数;If the third thread is a read access thread/write access thread, detecting whether the third thread has read access/write access rights, and acquiring the third when it has read access/write access rights The number of accesses corresponding to the thread;
    当所述访问次数为1时,将所述线程移除缓存,并唤醒处于休眠状态的线程;When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up;
    当所述访问次数大于1时,将所述访问次数减一,并唤醒处于休眠状态的线程。When the number of accesses is greater than 1, the number of accesses is decremented by one, and the thread in the dormant state is woken up.
  11. 根据权利要求5所述基于同步锁的多线程处理方法,其中,所述多线程处理方法还包括:The method according to claim 5, wherein the multi-thread processing method further comprises:
    当访问所述同一资源的第三线程离开时,判断所述第三线程的访问类型;Determining an access type of the third thread when a third thread accessing the same resource leaves;
    若所述第三线程为读访问线程/写访问线程时,则检测所述第三线程是否具有读访问权限/写访问权限,并在其具有读访问权限/写访问权限时获取所述第三线程对应的访问次数;If the third thread is a read access thread/write access thread, detecting whether the third thread has read access/write access rights, and acquiring the third when it has read access/write access rights The number of accesses corresponding to the thread;
    当所述访问次数为1时,将所述线程移除缓存,并唤醒处于休眠状态的线程;When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up;
    当所述访问次数大于1时,将所述访问次数减一,并唤醒处于休眠状态的线程。When the number of accesses is greater than 1, the number of accesses is decremented by one, and the thread in the dormant state is woken up.
  12. 根据权利要求6所述基于同步锁的多线程处理方法,其中,所述多线 程处理方法还包括:The multiplex lock processing method according to claim 6, wherein the multi-thread processing method further comprises:
    当访问所述同一资源的第三线程离开时,判断所述第三线程的访问类型;Determining an access type of the third thread when a third thread accessing the same resource leaves;
    若所述第三线程为读访问线程/写访问线程时,则检测所述第三线程是否具有读访问权限/写访问权限,并在其具有读访问权限/写访问权限时获取所述第三线程对应的访问次数;If the third thread is a read access thread/write access thread, detecting whether the third thread has read access/write access rights, and acquiring the third when it has read access/write access rights The number of accesses corresponding to the thread;
    当所述访问次数为1时,将所述线程移除缓存,并唤醒处于休眠状态的线程;When the number of accesses is 1, the thread is removed from the cache, and the thread in the sleep state is woken up;
    当所述访问次数大于1时,将所述访问次数减一,并唤醒处于休眠状态的线程。When the number of accesses is greater than 1, the number of accesses is decremented by one, and the thread in the dormant state is woken up.
  13. 一种存储介质,其中,其存储有多条指令,所述指令适于由处理器加载并执行基于同步锁的多线程处理方法,所述多线程处理方法包括:A storage medium, wherein it stores a plurality of instructions adapted to be loaded by a processor and to execute a synchronization lock based multi-thread processing method, the multi-thread processing method comprising:
    当多线程访问同一数据资源时,将所述多线程依照访问时间排序,并依照排序依次访问预设的同步锁;When multiple threads access the same data resource, the multiple threads are sorted according to the access time, and the preset synchronization locks are sequentially accessed according to the sorting;
    通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源。Controlling, by the synchronization lock, a thread having a write permission to individually access the same data resource, and a continuous multi-thread having read permission to simultaneously access the same data resource.
  14. 根据权利要求13所述存储介质,其中,所述通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源具体包括:The storage medium of claim 13, wherein the controlling, by the synchronization lock, a thread having a write permission to access the same data resource separately, and a continuous multi-thread having a read permission simultaneously accessing the same data resource comprises:
    当第一线程访问同步锁时,检测所述第一线程需要获取的访问权限,其中,所述访问权限包括读访问权限和写访问权限;When the first thread accesses the synchronization lock, detecting the access permission that the first thread needs to obtain, wherein the access permission includes a read access right and a write access right;
    当所述第一线程需要获取读访问权限时,检测所述第一线程是否具有写访问权限;When the first thread needs to acquire read access rights, detecting whether the first thread has write access rights;
    若所述第一线程具有写访问权限,则为所述第一线程配置读访问权限,并控制所述第一线程访问所述同一数据资源。If the first thread has write access rights, configure read access rights for the first thread, and control the first thread to access the same data resource.
  15. 根据权利要求14所述存储介质,其中,所述通过所述同步锁控制具 有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源还包括:The storage medium of claim 14, wherein the controlling, by the synchronization lock, a thread having a write permission to individually access the same data resource, and the plurality of threads having a read permission simultaneously accessing the same data resource further comprises:
    若所述第一线程不具有写访问权限,则检测所述同一数据资源是否处于被第一写访问线程访问状态;If the first thread does not have write access rights, detecting whether the same data resource is in a state accessed by the first write access thread;
    若所述同一数据资源未处于被第一写访问线程访问状态,则检测是否存在处于等待状态的第二写访问线程;If the same data resource is not in the access state by the first write access thread, detecting whether there is a second write access thread in the waiting state;
    当不存在第二写访问线程时,为所述第一线程配置写访问权限,并控制所述第一线程访问所述同一数据资源;When the second write access thread does not exist, configuring write access rights for the first thread, and controlling the first thread to access the same data resource;
    当存在第二写访问线程时,控制所述第一线程线程休眠状态。The first thread thread sleep state is controlled when there is a second write access thread.
  16. 根据权利要求15所述存储介质,其中,所述通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源还包括:The storage medium according to claim 15, wherein said controlling, by said synchronization lock, a thread having a write permission to individually access said same data resource, and said plurality of threads having read permission simultaneously accessing said same data resource further comprises:
    若所述同一数据资源处于被第一写访问线程访问状态,则判断所述第一线程与所述第一写访问线程是否相同;If the same data resource is in the access state by the first write access thread, determining whether the first thread is the same as the first write access thread;
    如果所述第一线程与所述第一写访问线程相同,则为所述第一线程配置读访问权限,并控制所述第一线程访问所述同一数据资源,以及将所述第一线程的访问次数加一;If the first thread is the same as the first write access thread, configuring read access rights for the first thread, and controlling the first thread to access the same data resource, and the first thread The number of visits is increased by one;
    如果所述第一线程与所述第一写访问线程不相同,则控制所述第一线程进入休眠状态。If the first thread is different from the first write access thread, controlling the first thread to enter a sleep state.
  17. 根据权利要求14所述存储介质,其中,所述通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源还包括:The storage medium of claim 14, wherein the controlling, by the synchronization lock, a thread having a write permission to access the same data resource separately, and a continuous multi-thread having a read permission simultaneously accessing the same data resource further comprises:
    当所述第一线程需要获取写访问权限时,检测所述同一数据资源是否处于空闲状态;When the first thread needs to obtain write access rights, detecting whether the same data resource is in an idle state;
    当所述同一数据资源处于空闲状态时,为所述第一线程配置写访问权限, 并控制所述第一线程访问所述同一数据资源。And when the same data resource is in an idle state, configuring write access rights for the first thread, and controlling the first thread to access the same data resource.
  18. 根据权利要求17所述存储介质,其中,所述通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源还包括:The storage medium according to claim 17, wherein said controlling, by said synchronization lock, a thread having a write permission to individually access said same data resource, and said plurality of threads having read permission simultaneously accessing said same data resource further comprises:
    当所述同一数据资源未处于空闲状态时,判断访问所述同一数据资源的第二线程的类型,其中,所述类型包括读访问线程和写访问线程;Determining, when the same data resource is not in an idle state, a type of a second thread accessing the same data resource, where the type includes a read access thread and a write access thread;
    若所述第二线程的类型为读访问线程,则控制所述第一线程进入等待状态。If the type of the second thread is a read access thread, the first thread is controlled to enter a wait state.
  19. 根据权利要求18所述存储介质,其中,所述通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源还包括:The storage medium according to claim 18, wherein said controlling, by said synchronization lock, a thread having a write permission to individually access said same data resource, and said plurality of threads having read permission simultaneously accessing said same data resource further comprises:
    若所述第二线程的类型为写访问线程,则检测所述第一线程与所述第二线程是否相同;If the type of the second thread is a write access thread, detecting whether the first thread is the same as the second thread;
    若所述第一线程与所述第二线程相同,则为所述第一线程配置写访问权限,并控制所述线程访问所述同一数据资源,以及将所述线程的访问次数加一;If the first thread is the same as the second thread, configure write access rights for the first thread, and control the thread to access the same data resource, and increase the number of accesses of the thread by one;
    若所述第一线程与所述第二线程不相同,则控制所述第一线程进入等待状态。If the first thread is different from the second thread, controlling the first thread to enter a waiting state.
  20. 一种终端,其中,其包括:A terminal, wherein:
    处理器,适于实现各指令;以及a processor adapted to implement each instruction;
    存储设备,适于存储多条指令,所述指令适于由处理器加载并执行基于同步锁的多线程处理方法,所述多线程处理方法包括:The storage device is adapted to store a plurality of instructions, the instructions being adapted to be loaded by the processor and executing a synchronization lock based multi-thread processing method, the multi-thread processing method comprising:
    当多线程访问同一数据资源时,将所述多线程依照访问时间排序,并依照排序依次访问预设的同步锁;When multiple threads access the same data resource, the multiple threads are sorted according to the access time, and the preset synchronization locks are sequentially accessed according to the sorting;
    通过所述同步锁控制具有写权限线程单独访问所述同一数据资源、以及具有读权限的连续多线程同时访问所述同一数据资源。Controlling, by the synchronization lock, a thread having a write permission to individually access the same data resource, and a continuous multi-thread having read permission to simultaneously access the same data resource.
PCT/CN2018/106215 2017-09-18 2018-09-18 Synchrolock-based multi-thread processing method, terminal and storage medium WO2019052576A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710842005.2 2017-09-18
CN201710842005.2A CN107729129A (en) 2017-09-18 2017-09-18 A kind of multithread processing method based on synchrolock, terminal and storage medium

Publications (1)

Publication Number Publication Date
WO2019052576A1 true WO2019052576A1 (en) 2019-03-21

Family

ID=61207606

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106215 WO2019052576A1 (en) 2017-09-18 2018-09-18 Synchrolock-based multi-thread processing method, terminal and storage medium

Country Status (2)

Country Link
CN (1) CN107729129A (en)
WO (1) WO2019052576A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729129A (en) * 2017-09-18 2018-02-23 惠州Tcl移动通信有限公司 A kind of multithread processing method based on synchrolock, terminal and storage medium
CN110622478B (en) * 2018-04-08 2020-11-06 华为技术有限公司 Method and device for data synchronous processing
CN109213583B (en) * 2018-07-25 2022-03-29 中国科学院计算技术研究所 I/O scheduler supporting read-write performance isolation through cooperation of software and hardware
CN111985977A (en) * 2020-09-07 2020-11-24 中国银行股份有限公司 Batch ticket issuing method and device
CN112764941A (en) * 2021-01-26 2021-05-07 北京字节跳动网络技术有限公司 Resource access method and device, electronic equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005486A (en) * 2006-12-28 2007-07-25 金蝶软件(中国)有限公司 Resource access control method and system
US20100333096A1 (en) * 2009-06-26 2010-12-30 David Dice Transactional Locking with Read-Write Locks in Transactional Memory Systems
CN103729239A (en) * 2013-11-18 2014-04-16 芜湖大学科技园发展有限公司 Distributed type lock algorithm of mirror-image metadata
CN105224251A (en) * 2015-09-28 2016-01-06 浪潮(北京)电子信息产业有限公司 A kind of Read-Write Locks optimization method based on Linux and system
CN107729129A (en) * 2017-09-18 2018-02-23 惠州Tcl移动通信有限公司 A kind of multithread processing method based on synchrolock, terminal and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7188344B1 (en) * 1999-12-21 2007-03-06 Unisys Corporation Architecture for a read/write thread lock
US6978330B1 (en) * 2002-04-04 2005-12-20 Applied Micro Circuits Corporation Shared resource access via declarations that contain a sequence number of a packet
US8607239B2 (en) * 2009-12-31 2013-12-10 International Business Machines Corporation Lock mechanism to reduce waiting of threads to access a shared resource by selectively granting access to a thread before an enqueued highest priority thread
WO2012132017A1 (en) * 2011-03-31 2012-10-04 富士通株式会社 Exclusion control method and exclusion control program
CN105045938A (en) * 2015-09-17 2015-11-11 浪潮(北京)电子信息产业有限公司 Metadata concurrent access method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005486A (en) * 2006-12-28 2007-07-25 金蝶软件(中国)有限公司 Resource access control method and system
US20100333096A1 (en) * 2009-06-26 2010-12-30 David Dice Transactional Locking with Read-Write Locks in Transactional Memory Systems
CN103729239A (en) * 2013-11-18 2014-04-16 芜湖大学科技园发展有限公司 Distributed type lock algorithm of mirror-image metadata
CN105224251A (en) * 2015-09-28 2016-01-06 浪潮(北京)电子信息产业有限公司 A kind of Read-Write Locks optimization method based on Linux and system
CN107729129A (en) * 2017-09-18 2018-02-23 惠州Tcl移动通信有限公司 A kind of multithread processing method based on synchrolock, terminal and storage medium

Also Published As

Publication number Publication date
CN107729129A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
WO2019052576A1 (en) Synchrolock-based multi-thread processing method, terminal and storage medium
US9411646B2 (en) Booting secondary processors in multicore system using kernel images stored in private memory segments
US8904216B2 (en) Massively multicore processor and operating system to manage strands in hardware
TWI729003B (en) Method, device, and processor-readable storage medium for efficient task scheduling in the presence of conflicts
JP5752326B2 (en) Dynamic sleep for multi-core computing devices
US20170357536A1 (en) Task processing device
US9152474B2 (en) Context aware synchronization using context and input parameter objects associated with a mutual exclusion lock
US20170351541A1 (en) Task processor
US10380058B2 (en) Processor core to coprocessor interface with FIFO semantics
CN107017014B (en) Dynamic containerized system memory protection for low energy MCU
US11537430B1 (en) Wait optimizer for recording an order of first entry into a wait mode by a virtual central processing unit
US10579413B2 (en) Efficient task scheduling using a locking mechanism
US11005970B2 (en) Data storage system with processor scheduling using distributed peek-poller threads
JP2018534676A5 (en)
US10176132B2 (en) Configuration arbiter for multiple controllers sharing a link interface
JP2018528515A (en) A method for a simplified task-based runtime for efficient parallel computing
US10740496B2 (en) Method and apparatus for operating multi-processor system in electronic device
US9582340B2 (en) File lock
US9645630B2 (en) Selectively permitting an apparatus to be awakened depending on a programmable setting
US20170308154A1 (en) Fast system setting changes
US8935700B2 (en) Efficient lock hand-off in a symmetric multiprocessor system
US11249656B2 (en) Performance optimization for active-active locking using sticking affinity for storage objects
KR102333693B1 (en) Method and apparatus for operating multi-processor system in electronic device
US10158580B2 (en) Utilizing access control data structures for sharing computing resources
CN205959186U (en) Medical treatment multithreading common shared resources system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18855460

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18855460

Country of ref document: EP

Kind code of ref document: A1