CN107391266A - A kind of graphic programming Multithread Synchronization Program - Google Patents
A kind of graphic programming Multithread Synchronization Program Download PDFInfo
- Publication number
- CN107391266A CN107391266A CN201710405733.7A CN201710405733A CN107391266A CN 107391266 A CN107391266 A CN 107391266A CN 201710405733 A CN201710405733 A CN 201710405733A CN 107391266 A CN107391266 A CN 107391266A
- Authority
- CN
- China
- Prior art keywords
- thread
- programming
- synchronization
- graphic programming
- component
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
The invention provides a kind of graphic programming Multithread Synchronization Program, user is patterned programming, the multithreading in graphic programming is managed using graphic programming Multithread Synchronization Program with it is synchronous, solve the problems, such as that existing graphic programming system does not support Multi-thread synchronization.For the present invention when carrying out multiple threads, to forming directed acyclic graph by graphic programming component, single connected component therein carries out depth-first search, and program component is handled one by one.When the program component is a branch node, new branch's thread active flag is added, and terminate current thread;When the program component is that a branch merges point, the first father's program component node merged a little is responsible for starting thread, and adds thread and wait mark, waits the synchronization of graphical programming thread.The present invention can make graphical multi-thread programming have the function of thread synchronization, programming personnel is write the graphical programs with more rich function.
Description
Technical field
The present invention relates generally to graphic programming field, and in particular to graphic programming Multithread Synchronization Program.
Background technology
With the development of society, people's living standards continue to improve, the rapid development of simultaneous computer technology, software and hardware
Programming has no longer been the full-time job of IT personnel, and programmer may be from all trades and professions in society.But the in fact, generation of program
Boundary is still that most of user is elusive, the highly difficult stumbling-block for becoming people and exploring PC World of programming.It is non-
The programming user of computer major, it is the specific group of programming arts, as the number using computer increases and constantly
Deeply, they will increasingly feel the needs of existing hardware and software platform can not meet them, and they wish that programming tool uses
Simply, it is powerful;And the more desirable use of programming personnel easy-to-use, the readable strong programming language directly perceived of specialty.Different from text
This type programming language, graphical programming language are that bottom layer realization can be packaged by one kind, and user only needs simple pull to compile
Journey component, it can just complete the programming language of the corresponding programmed tasks with complex logic.For most Non-computer Majors
User for, the graphical programming language of simple, intuitive can bring great convenience to them.
Existing graphical programming software is not common, and mostly form is fixed, because design difficulty is high or software lacks
Fall into, do not support graphic programming Multi-thread synchronization, inconvenience is brought to user.
The content of the invention
A kind of deficiency of the present invention for current Graphicsization programming art, there is provided graphic programming Multi-thread synchronization
Method.It is an object of the invention to provide a kind of graphic programming Multithread Synchronization Program of highly effective, branch can be opened
Graphic programming multithreading synchronize, so as to realize more complicated graphical programs, concrete technical scheme is as follows.
A kind of graphic programming Multithread Synchronization Program, it comprises the following steps:
(a) depth-first search is carried out to each connected component being made up of graphic programming component, program component is carried out one by one
Processing, and do not accessed by respectively different mark and accessed node, to ensure the connection point being made up of graphic programming component
The directed acyclic of amount;
(b) when the program component of processing is a branch node, new graphic programming thread is added;
(c) when the program component of processing is that a branch merges point(That is thread synchronization point)When, it is patterned programming thread
It is synchronous;
In a kind of above-mentioned graphic programming Multithread Synchronization Program, step (b) comprises the following steps:
(b-1) currently processed program component is accessed, analyzes syntactic structure, and be translated as programming on bottom layer language.Wherein programming group
Part has the function of determining, corresponding programming on bottom layer language;
(b-2) to each branch of node, new thread active flag is added;
(b-3) the graphic programming thread that will newly start, thread allocation table is added;
(b-4) ended up in current thread, add thread end mark
(b-5) current thread is removed into thread allocation table.
In a kind of above-mentioned graphic programming Multithread Synchronization Program, in step (b-2), the thread active flag is used to open
Move new graphic programming thread;In step (b-4), the thread end mark is used to terminate current Graphicsization programming thread.
In a kind of above-mentioned graphic programming Multithread Synchronization Program, in step (b-3), the thread allocation table is used to record
Current Graphicsization program the distribution condition of thread.
In a kind of above-mentioned graphic programming Multithread Synchronization Program, step (c) comprises the following steps:
(c-1) new thread after startup synchronization, and add thread allocation table;
(c-2) add thread and wait mark;
(c-3) syntactic structure of currently processed program component is analyzed, and is translated as programming on bottom layer language.
In a kind of above-mentioned graphic programming Multithread Synchronization Program, in step (c-1), new thread is figure after the synchronization
Change the new thread after thread synchronization, startup is responsible for by first father's program component node for merging point, that is, merge the of point
Thread active flag is added after one father's program component node processing.
In a kind of above-mentioned graphic programming Multithread Synchronization Program, in step (c-2), the thread waits mark, is used for
Wait the synchronization of graphical programming thread, that is, need to wait for all current syncs graphic programming thread be all disposed after,
Carry out the processing of current program component.
Compared with prior art, the invention has the advantages that and technique effect:
In today that Parallelizing Techniques are showing improvement or progress day by day, it has been difficult to win using conventional programming languages such as such as Fortran or C language
To appoint, high-level programming language can preferably support multi-thread programming, but as the graphical programming language of high-level programming language,
Still seem on multi-thread programming weak, do not support inter-thread synchronization.The present invention is when carrying out multiple threads, to single figure
Change program component connected component and carry out depth-first search, program component is handled one by one.When the program component is one point
During Zhi Jiedian, new branch's thread active flag is added, and terminate current thread;When the program component is that a branch merges point
(That is thread synchronization point)When, the first father's program component node merged a little is responsible for starting thread, and adds thread and wait mark
Will, wait the synchronization of graphical programming thread.The Multi-thread synchronization of graphic programming is realized, has graphical multi-thread programming
There is more rich function, improve the operating efficiency of programming personnel.
Brief description of the drawings
Fig. 1 is the flow chart of graphic programming Multithread Synchronization Program in embodiment.
Embodiment
Embodiments of the present invention are described further below in conjunction with accompanying drawing, but the implementation not limited to this of the present invention.
Such as Fig. 1, a kind of main flow of graphic programming Multithread Synchronization Program comprises the following steps:
(a) depth-first search is carried out to each connected component being made up of graphic programming component, program component is carried out one by one
Processing, and do not accessed by mark and accessed node, with the oriented of the connected component that ensures to be made up of graphic programming component
It is acyclic;
(b) when the program component of processing is a branch node, new graphic programming thread is added;
(c) when the program component of processing is that a branch merges point(That is thread synchronization point)When, it is patterned programming thread
It is synchronous.
Step (a) be by carrying out depth-first search to the single connected component that is made up of graphic programming component, time
The each summit gone through into the connected component, first compiler are not accessed by respectively different mark and accessed node, such as
During the node that fruit is not accessed before attempting to access that one, it is found that the node has been accessed, represent the connected component and deposit
Do not allow then by compiling in ring, the directed acyclic of connected component that is made up of graphic programming component ensured with this, then by
One is compiled and thread distribution.
Step (b) is when handling each program component node, if to run into current program component be a branch node,
A new thread can be generated for each branch.
Step (b) comprises the following steps:
(b-1) currently processed program component is accessed, analyzes syntactic structure, and be translated as programming on bottom layer language.Wherein programming group
Part has the function of determining, corresponding programming on bottom layer language;
(b-2) to each branch of node, new thread active flag is added;
(b-3) the graphic programming thread that will newly start, thread allocation table is added;
(b-4) ended up in current thread, add thread end mark;
(b-5) current thread is removed into thread allocation table.
Wherein step (b-2) the thread active flag is used to start new graphic programming thread;Step (b-4) described line
Journey end mark is used to terminate current Graphicsization programming thread.
Step (b-3) the thread allocation table is used for the distribution condition for recording current Graphicsization programming thread, facilitates thread
Global access.
Step (c) is the committed step of Multi-thread synchronization, when handling each program component node, if running into current volume
Journey component is that a branch merges point(That is thread synchronization point)When, the graphic programming thread for needing to wait for all current syncs is all located
After reason, just continue to handle.
Step (c) comprises the following steps:
(c-1) new thread after startup synchronization, and add thread allocation table;
(c-2) add thread and wait mark;
(c-3) syntactic structure of currently processed program component is analyzed, and is translated as programming on bottom layer language.
New thread is the new thread after graphical thread synchronization after step (c-1) described synchronization, by first that merges point
Father's program component node is responsible for startup, i.e., adding thread after first father's program component node processing of point is merged starts
Mark.
Step (c-2) thread waits mark, for waiting the synchronization of graphical programming thread, that is, needs to wait for all work as
After the graphic programming thread of preamble is all disposed, the processing of current program component is just carried out.
The present invention carries out depth-first when carrying out multiple threads, to single graphic programming component connected component and searched
Rope, one by one program component handled.When the program component is a branch node, adds new branch's thread and start mark
Will, and terminate current thread;When the program component is that a branch merges point(That is thread synchronization point)When, merge first a little
Father's program component node is responsible for starting thread, and adds thread and wait mark, waits the synchronization of graphical programming thread.Realize
The Multi-thread synchronization of graphic programming, makes graphical multi-thread programming have more rich function, improves the work of programming personnel
Make efficiency.
Claims (7)
1. a kind of graphic programming Multithread Synchronization Program, it is characterised in that comprise the following steps:
(a) depth-first search is carried out to each connected component being made up of graphic programming component, program component is carried out one by one
Processing, and do not accessed by respectively different mark and accessed node, to ensure the connection point being made up of graphic programming component
The directed acyclic of amount;
(b) when the program component of processing is a branch node, new graphic programming thread is added;
(c) when the program component of processing is that a branch merges the i.e. thread synchronization point of point, it is patterned the same of programming thread
Step.
A kind of 2. graphic programming Multithread Synchronization Program according to claim 1, it is characterised in that step (b) include with
Lower step:
(b-1) currently processed program component is accessed, analyzes syntactic structure, and be translated as programming on bottom layer language;
Wherein program component has the function of determining, corresponding programming on bottom layer language;
(b-2) to each branch of node, new thread active flag is added;
(b-3) the graphic programming thread that will newly start, thread allocation table is added;
(b-4) ended up in current thread, add thread end mark;
(b-5) current thread is removed into thread allocation table.
3. a kind of graphic programming Multithread Synchronization Program according to claim 2, it is characterised in that step (b-2) is described
Thread active flag is used to start new graphic programming thread;Step (b-4) the thread end mark is used to terminate currently to scheme
Shapeization programs thread.
4. a kind of graphic programming Multithread Synchronization Program according to claim 2, it is characterised in that step (b-3) is described
Thread allocation table is used for the distribution condition for recording current Graphicsization programming thread.
A kind of 5. graphic programming Multithread Synchronization Program according to claim 1, it is characterised in that step (c) include with
Lower step:
(c-1) new thread after startup synchronization, and add thread allocation table;
(c-2) add thread and wait mark;
(c-3) syntactic structure of currently processed program component is analyzed, and is translated as programming on bottom layer language.
6. a kind of graphic programming Multithread Synchronization Program according to claim 5, it is characterised in that step (c-1) is described
New thread is the new thread after graphical thread synchronization after synchronization, is responsible for opening by first father's program component node for merging point
It is dynamic, i.e., add thread active flag after first father's program component node processing of point is merged.
7. a kind of graphic programming Multithread Synchronization Program according to claim 5, it is characterised in that step (c-2) is described
Thread waits mark, for waiting the synchronization of graphical programming thread, that is, needs to wait for the graphic programming line of all current syncs
After journey is all disposed, the processing of current program component is just carried out.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710405733.7A CN107391266B (en) | 2017-06-01 | 2017-06-01 | Graphical programming multithreading synchronization method |
PCT/CN2017/113873 WO2018218908A1 (en) | 2017-06-01 | 2017-11-30 | Graphical programming multi-thread synchronization method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710405733.7A CN107391266B (en) | 2017-06-01 | 2017-06-01 | Graphical programming multithreading synchronization method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107391266A true CN107391266A (en) | 2017-11-24 |
CN107391266B CN107391266B (en) | 2021-03-30 |
Family
ID=60331930
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710405733.7A Active CN107391266B (en) | 2017-06-01 | 2017-06-01 | Graphical programming multithreading synchronization method |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107391266B (en) |
WO (1) | WO2018218908A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018218908A1 (en) * | 2017-06-01 | 2018-12-06 | 华南理工大学 | Graphical programming multi-thread synchronization method |
CN109634572A (en) * | 2018-12-17 | 2019-04-16 | 王相军 | A kind of flow chart programming method and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1501603A (en) * | 2002-11-17 | 2004-06-02 | 华为技术有限公司 | Method for implementing parallel script execution |
CN1853165A (en) * | 2003-09-30 | 2006-10-25 | 英特尔公司 | Methods and apparatuses for compiler-creating helper threads for multi-threading |
US8549470B2 (en) * | 2008-12-11 | 2013-10-01 | The Mathworks, Inc. | Multi-threaded subgraph execution control in a graphical modeling environment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6421821B1 (en) * | 1999-03-10 | 2002-07-16 | Ronald J. Lavallee | Flow chart-based programming method and system for object-oriented languages |
CN103077006B (en) * | 2012-12-27 | 2015-08-26 | 浙江工业大学 | A kind of Long routine executed in parallel method based on multithreading |
CN103207903B (en) * | 2013-03-26 | 2015-11-18 | 南京南瑞继保电气有限公司 | A kind of visualized graphs program topological sorting method |
CN105468445B (en) * | 2015-11-20 | 2020-01-14 | Tcl集团股份有限公司 | WEB-based Spark application program scheduling method and system |
CN107391266B (en) * | 2017-06-01 | 2021-03-30 | 华南理工大学 | Graphical programming multithreading synchronization method |
-
2017
- 2017-06-01 CN CN201710405733.7A patent/CN107391266B/en active Active
- 2017-11-30 WO PCT/CN2017/113873 patent/WO2018218908A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1501603A (en) * | 2002-11-17 | 2004-06-02 | 华为技术有限公司 | Method for implementing parallel script execution |
CN1853165A (en) * | 2003-09-30 | 2006-10-25 | 英特尔公司 | Methods and apparatuses for compiler-creating helper threads for multi-threading |
US8549470B2 (en) * | 2008-12-11 | 2013-10-01 | The Mathworks, Inc. | Multi-threaded subgraph execution control in a graphical modeling environment |
Non-Patent Citations (2)
Title |
---|
尹华祥等: "图形化编程中模块间并行性的自动挖掘", 《计算机工程》 * |
王蕾等: "任务并行编程模型研究与进展", 《软件学报》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018218908A1 (en) * | 2017-06-01 | 2018-12-06 | 华南理工大学 | Graphical programming multi-thread synchronization method |
CN109634572A (en) * | 2018-12-17 | 2019-04-16 | 王相军 | A kind of flow chart programming method and system |
Also Published As
Publication number | Publication date |
---|---|
WO2018218908A1 (en) | 2018-12-06 |
CN107391266B (en) | 2021-03-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Singh et al. | Kiwi: Synthesis of FPGA circuits from parallel programs | |
Pnueli et al. | JTLV: A framework for developing verification algorithms | |
US8972933B2 (en) | Non-literal representation of programming language code | |
Burke et al. | Concurrent Collections Programming Model. | |
Wenzel | Asynchronous user interaction and tool integration in Isabelle/PIDE | |
CN106687921A (en) | Specifying components in graph-based programs | |
CN106663075A (en) | Executing graph-based program specifications | |
CN106687918A (en) | Compiling graph-based program specifications | |
WO2007083613A1 (en) | Program processing device, parallel processing program, program processing method, parallel processing compiler, recording medium containing the parallel processing compiler, and multi-processor system | |
CN104965761A (en) | Flow program multi-granularity division and scheduling method based on GPU/CPU hybrid architecture | |
CN106687919A (en) | Managing state for controlling tasks | |
CN106605209A (en) | Controlling data processing tasks | |
CN107391266A (en) | A kind of graphic programming Multithread Synchronization Program | |
Cavalcanti et al. | Safety-critical Java in circus | |
Taura et al. | Fine-grain multithreading with minimal compiler support—a cost effective approach to implementing efficient multithreading languages | |
CN109308213A (en) | Based on the multitask breakpoint debugging method for improving Task Scheduling Mechanism | |
Jongmans et al. | Modularizing and specifying protocols among threads | |
US9361119B1 (en) | Active code component identification and manipulation for preprocessor variants | |
Ishikawa et al. | MPC++ | |
He et al. | OpenMDSP: extending OpenMP to program multi-core DSPs | |
Halpern | Strict fork-join parallelism | |
Ertel et al. | Ohua: Implicit dataflow programming for concurrent systems | |
Mohan et al. | Temporal analysis for adapting concurrent applications to embedded systems | |
Wang et al. | A simple model for certifying assembly programs with first-class function pointers | |
Scott et al. | A grammar-based approach to automatic generation of user-interface dialogues |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |