Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method of implementing inter-task sharing data

A technology for sharing data and tasks, applied in the field of computer systems, can solve problems such as complex coding, time-consuming, difficult to locate faults, etc., and achieve the effect of simplifying coding and avoiding deadlock problems

Inactive Publication Date: 2008-04-16
杭州戈虎达科技有限公司
View PDF0 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Sometimes the operation of the data in the critical section is simple, there are not many instructions, and the operation can be completed quickly, but the operation of locking and unlocking takes a lot of time, and the code cannot improve efficiency
[0006] 2. The coding is complex, once a deadlock occurs, it is not easy to locate the fault
Since the critical section can be accessed multiple times in a task, if a certain access does not release the lock, the subsequent access cannot be performed, but the occupant of the lock is himself, so he can only walk through the code to find the problem

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
  • Method of implementing inter-task sharing data

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0037] The method of sharing data between tasks should be free of protection. The key is to allow only one task to access the critical area, and other tasks are not allowed to access the critical area. For example, there are n tasks, and they share the data area D. Then it is stipulated that only one task can access the data area D, and other tasks cannot directly access the data area D, and can only send messages to tasks with access rights. The message specifies the access action, which can be a function name or other numbers that can indicate the action. . After receiving the message, the tasks with access rights execute actions and operate the shared data. After running, send a response message to the initiator of the action. The task that initiates the action determines the follow-up operation according to the response message.

[0038] The message exchange process is as figure 1 As shown, the following is an example of this method to share data between two tasks.

...

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 method for realizing data sharing among tasks. The problems that deadlock is easy to be generated by multi tasks when visiting the sharing data area and the fault is not easy to be localized are solved. The invention includes that the task without the authority to visit the sharing data area sends an ACTION message to the task with visit authority; after the task with visit authority receives the message, the task runs corresponding program and operates the sharing data area according to the content of the message; after the running is over, the task with visit authority sends a responses message to the sender of the ACTION message; the responses message comprises the result of running; the sharing data area of the invention need not to be protected and the sharing data area data can be safely visited among tasks. The lock and other protection mechanisms are not considered and the code is simplified. The deadlock can not be generated without lock ,so the problem of deadlock is completely avoided.

Description

technical field [0001] The invention relates to the field of computer systems, in particular to a method for realizing data sharing between tasks. It is especially suitable for access processing of shared data by tasks such as timers and backgrounds. Background technique [0002] Computer systems, whether it is a large graphical operating system or a program running on a small chip, often use multi-tasking processing methods. Each task has different functions, and some information is exchanged between tasks through messages. These tasks sometimes need to access the same data area, and the data accessed by multiple tasks is shared data, also known as critical area. Due to multi-task access, the critical section must be guaranteed not to be modified during the access of a certain task, that is, other tasks are not allowed to access the critical section until the current task is used up. Only in this way can the data in the critical section be correct. For example, in the b...

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): H04L12/56H04L12/24H04L1/16G06F15/163H04L29/06
Inventor 赵欣
Owner 杭州戈虎达科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products