Multi-thread finite state machine switching method and multi-thread finite state machine switching device based on thread pool

A technology of finite state machine and switching device, which is applied in multi-programming device, resource allocation and other directions, can solve the problems of unrealizable operation, insufficient single-thread power, complicated design, etc., and achieves rich role objects, smooth system operation, and higher utilization. rate effect

Inactive Publication Date: 2013-07-24
GUANGDONG VTRON TECH CO LTD
View PDF4 Cites 18 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, in some small games such as mobile games or FLASH games on PC, considering the factors of development cost and cycle, they are almost all implemented in a single-threaded way, which causes complex behaviors of multiple characters to appear in one scene at the same time. , sometimes the system freezes, and even many complex operations cannot be realized, but only some compromised design solutions can be selected to complete
[0003] There are many different types of characters in the game scene, when the gameplay is diverse and the skills are rich, such as large-scale 3D online games, or when the machine itself is still running multiple background services, the operation of multiple character states is not coordinated, and multitasking cannot be performed. Simultaneously, especially when mobile phones have entered the era of dual-core or even quad-core, and various game applications have begun to expand various gameplays and 3D effects like desktop computers, single-threaded processing of such problems seems powerless, even if it can implementation, the program code is also very complex and inefficient, and the management of threads is relatively confusing
Often resulting in overly complex designs, long development cycles, and poor implementation results
It may even lead to the failure of operation due to poor development effect and poor user experience, making the hard-developed game products unprofitable

Method used

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

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Multi-thread finite state machine switching method and multi-thread finite state machine switching device based on thread pool
  • Multi-thread finite state machine switching method and multi-thread finite state machine switching device based on thread pool
  • Multi-thread finite state machine switching method and multi-thread finite state machine switching device based on thread pool

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0020] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings.

[0021] figure 1 It is a flow chart of the thread pool-based multi-thread finite state machine switching method of the present invention, including:

[0022] S101: Put the idle threads in the thread pool into the standby queue, and set the threads in the queue to be blocked;

[0023] S102: When the application program triggers a behavior task, select an idle thread from the waiting queue to unblock, import the behavior task into this thread, and obtain a task thread in a busy state;

[0024] S103: Put the task thread into a work queue, and execute tasks in the work queue.

[0025] In game development, an application often needs to create and destroy threads frequently, and the task execution time is often relatively short, so the overhead caused by thread creatio...

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

PUM

No PUM Login to view more

Abstract

The invention discloses a multi-thread finite state machine switching method based on a thread pool. The method comprises the following steps of putting idle threads in the thread pool in a candidate queue and setting the threads in the queue in a blocked state; when an action task is triggered by an application program, selecting one idle thread from the candidate queue to relieve blocking, and leading the action task to the idle thread so as to obtain a task thread in a busy state; and putting the task thread in a work queue and executing a task in the work queue. With the method, the utilization rate of a CPU (Central Processing Unit) can be better increased through the optimal management of the thread pool, so that a system can run more smoothly.

Description

technical field [0001] The invention relates to thread design technology, in particular to a thread pool-based multi-thread finite state machine switching method. Background technique [0002] In the current field of game software development, a game often has multiple character objects in one scene for combat, cooperation, communication and other behavior processing. However, in some small games such as mobile games or FLASH games on PC, considering the factors of development cost and cycle, they are almost all implemented in a single-threaded way, which causes complex behaviors of multiple characters to appear in one scene at the same time. , sometimes the system freezes, and even many complex operations cannot be realized, but can only be completed by choosing some compromised design solutions. [0003] There are many different types of characters in the game scene, when the gameplay is diverse and the skills are rich, such as large-scale 3D online games, or when the mac...

Claims

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

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/50
Inventor 文剑峰
Owner GUANGDONG VTRON TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products