Semaphore function implementation method and device

An implementation method and semaphore technology, applied in the computer field, can solve problems such as the kernel does not provide semaphores

Pending Publication Date: 2021-04-06
北京和利时控制技术有限公司
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

For microkernel systems, the kernel does not provide a semaphore function

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
  • Semaphore function implementation method and device
  • Semaphore function implementation method and device
  • Semaphore function implementation method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0064] Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined arbitrarily with each other.

[0065] figure 1 It is a schematic diagram of the implementation method of the semaphore function of the embodiment of the present disclosure, such as figure 1 As shown, the implementation method of the semaphore function in this embodiment includes:

[0066] S11. The user thread invokes the semaphore interface function of the user space. After the semaphore interface function sends an interprocess communication IPC message to the semaphore management thread, the user thread is blocked;

[0067] S12. After the semaphore management thread receives the IPC message, the semaphore management thread invokes a processing function corresponding to the message type of the IPC message; ...

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 embodiment of the invention provides a semaphore function implementation method and device and a computer readable storage medium, and the method comprises the steps that a user thread calls a semaphore interface function of a user space, and the user thread is blocked after the semaphore interface function transmits an inter-process communication IPC message to a semaphore management thread; after the semaphore management thread receives the IPC message, the semaphore management thread calls a processing function corresponding to the message type of the IPC message, and after the called processing function executes the corresponding semaphore processing function, an IPC response message is constructed according to the processing result and returned to the called semaphore interface function, and the blocked user thread is awakened. According to the method, the device and the computer readable storage medium disclosed by the invention, the semaphore function of the PLC based on the microkernel operating system is realized.

Description

technical field [0001] The disclosure relates to the field of computers, in particular to a method and device for realizing semaphore functions. Background technique [0002] PLC controllers are widely used in the field of process control, and it is of great significance to improve the safety of PLC controllers. Based on the domestic MIPS architecture processor, Hollysys has developed a highly secure microkernel operating system kernel (microkernel for short), which runs in the kernel space. Hollysys developed PLC controller software based on the microkernel, and the PLC controller software runs in user space. [0003] For PLC software running in user space, the semaphore function is a basic function that the system must provide. PLC software uses semaphores to implement inter-process communication when multiple threads are concurrent, global data access protection, inter-thread synchronization and other functions. The semaphore function is usually implemented by the kern...

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/48G06F9/54
CPCG06F9/4837G06F9/4843G06F9/546
Inventor 王全利董广谱黄玲李蒙
Owner 北京和利时控制技术有限公司
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