CN106371899A - Thread parameter processing method and apparatus - Google Patents
Thread parameter processing method and apparatus Download PDFInfo
- Publication number
- CN106371899A CN106371899A CN201510434676.6A CN201510434676A CN106371899A CN 106371899 A CN106371899 A CN 106371899A CN 201510434676 A CN201510434676 A CN 201510434676A CN 106371899 A CN106371899 A CN 106371899A
- Authority
- CN
- China
- Prior art keywords
- thread
- parameter information
- change
- far call
- parent process
- 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.)
- Pending
Links
Landscapes
- Telephonic Communication Services (AREA)
Abstract
The invention discloses a thread parameter processing method and apparatus. The method comprises the steps of creating a remote call thread corresponding to a sub-thread; when the sub-thread runs, judging whether first parameter information in a parent process needs to be modified or not; when a judgment result is that the first parameter information needs to be modified, calling the remote call thread; and running the remote call thread to modify the first parameter information. Through the technical scheme provided by the method and the apparatus, when a child process runs, if an environment variable of the parent process needs to be modified, the environment variable of the parent process can be automatically modified on the basis of not exiting from the sub-process and not entering the parent process again to modify the environment variable of the parent process, so that the modification operation of the environment variable of the parent process is simplified, the child process is not interrupted, and the running efficiency and speed of the child process are ensured.
Description
Technical field
The present invention relates to thread process technical field, particularly to a kind of processing method of thread parameter and dress
Put.
Background technology
At present, parent process present in operating system is all created by system process, and after parent process is run,
Subprocess will statically inherit the environmental variable of parent process.But in the running of subprocess, needing
The environmental variable of parent process to be used, and need to change the occurrence of the environmental variable of parent process, could be normal
When completing to run, it usually needs subprocess out of service, and exit subprocess, reenter parent process, repair
Change the environmental variable of parent process, then rerun parent process, just can complete the change of environmental variable;In ring
After border variable is successfully changed, reenter subprocess again, make subprocess again start anew to run, ability
Inherit the amended environmental variable of parent process, then normally complete operation.This, running subprocess
During, in the environmental variable needing to change parent process, need first to exit subprocess, rerun father and enter
Cheng Caineng completes the scheme of the modification of the environmental variable of parent process, and operating process is comparatively laborious, and serious shadow
Operational efficiency and the speed of subprocess are rung.
Content of the invention
The present invention provide a kind of processing method and processing device of thread parameter, in order to run subprocess when, if
Need to change the environmental variable of parent process, subprocess can not exited, not reenter parent process to change
It is possible to automatically modify to the environmental variable of parent process on the basis of the environmental variable of parent process, with
Simplify the modification operation of the environmental variable of parent process, so that subprocess is not interrupted it is ensured that subprocess simultaneously
Operational efficiency and speed.
The present invention provides a kind of processing method of thread parameter, comprising: create corresponding with sub-line journey long-range
Call thread;
When described sub-line journey is run, judge whether to need to change the first parameter information in parent process;
When judged result is to need to change described first parameter information, call described far call thread;
Run described far call thread, to change described first parameter information.
In one embodiment, described establishment far call thread corresponding with sub-line journey, comprising:
Created described long-range by the remote thread process function in locally created described far call thread
Call thread.
In one embodiment, run described far call thread, with change described first parameter information it
Before, methods described also includes:
Described parent process is applied for process letter for storing described first parameter information and described remote thread
The internal memory of number;And
After successfully applying for described internal memory, described first parameter information and described remote thread are processed function and writes
Enter described parent process.
In one embodiment, described judged result be need to change described first parameter information when, call
Described far call thread, comprising:
When judged result is to need to change described first parameter information, will be with described the by described subprocess
It is described remote to call that corresponding second parameter information of one parameter information is transferred to described remote thread process function
Journey calls thread;
The described far call thread of described operation, to change described first parameter information, comprising:
When described remote thread processes function and receives described second parameter information, according to described second parameter
Information is run, to change described first parameter information.
The present invention also provides a kind of processing meanss of thread parameter, comprising:
Creation module, for creating far call thread corresponding with sub-line journey;
Judge module, for when described sub-line journey is run, judging whether to need to change first in parent process
Parameter information;
Calling module, for when judged result is to need to change described first parameter information, calling described remote
Journey calls thread;
Run module, for running described far call thread, to change described first parameter information.
In one embodiment, described creation module includes:
Create submodule, for function is processed by the remote thread in locally created described far call thread
To create described far call thread.
In one embodiment, described device also includes:
Application module, for running described far call thread, before changing described first parameter information,
Described parent process is applied for process function for storing described first parameter information and described remote thread
Internal memory;And
Processing module, for after successfully applying for described internal memory, by described first parameter information and described long-range
Thread process function writes described parent process.
In one embodiment, described calling module includes:
Transmission submodule, for when judged result is to need to change described first parameter information, by described
Second parameter information corresponding with described first parameter information is transferred to described remote thread process by subprocess
Function is calling described far call thread;
Described operation module includes:
Run submodule, for described remote thread process function receive described second parameter information when,
Run according to described second parameter information, to change described first parameter information.
The technical scheme that embodiment of the disclosure provides can include following beneficial effect:
When running subprocess, if necessary to change the environmental variable of parent process, just call corresponding with sub-line journey
Far call thread, then run this far call thread it is possible to realize do not exiting subprocess, no
Reenter parent process to change the environmental variable of parent process on the basis of, automatically the environment of parent process is become
Amount is modified, with simplify parent process environmental variable modification operation, allow simultaneously subprocess not in
Run it is ensured that the operational efficiency of subprocess and speed always disconnectedly.
Other features and advantages of the present invention will illustrate in the following description, and, partly from explanation
Become apparent in book, or understood by implementing the present invention.The purpose of the present invention and other advantages can
Realized by specifically noted structure in the description write, claims and accompanying drawing and obtain
?.
Below by drawings and Examples, technical scheme is described in further detail.
Brief description
Accompanying drawing is used for providing a further understanding of the present invention, and constitutes a part for description, with this
Bright embodiment is used for explaining the present invention together, is not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the processing method of thread parameter according to an exemplary embodiment.
Fig. 2 is the flow chart of the processing method of another kind of thread parameter according to an exemplary embodiment.
Fig. 3 is a kind of block diagram of the processing meanss of thread parameter according to an exemplary embodiment.
Fig. 4 is the block diagram of the processing meanss of another kind of thread parameter according to an exemplary embodiment.
Fig. 5 is the block diagram of the processing meanss of another thread parameter according to an exemplary embodiment.
Fig. 6 is the block diagram of the processing meanss of another thread parameter according to an exemplary embodiment.
Specific embodiment
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are illustrated it will be appreciated that described herein
Preferred embodiment is merely to illustrate and explains the present invention, is not intended to limit the present invention.
In correlation technique, in the running of subprocess, needing the environmental variable using parent process, and
Need to change the occurrence of the environmental variable of parent process, when just can normally complete operation, it usually needs stop fortune
Row subprocess, and exit subprocess, reenter parent process, the environmental variable of modification parent process, Ran Houchong
New operation parent process, just can complete the change of environmental variable;After environmental variable is successfully changed, again again
Enter subprocess, make subprocess again start anew to run, the amended environment that could inherit parent process becomes
Amount, then normally completes operation.This, during running subprocess, needing to change parent process
During environmental variable, need first to exit subprocess, rerun the environmental variable that parent process just can complete parent process
Modification scheme, operating process is comparatively laborious, and has had a strong impact on operational efficiency and the speed of subprocess.
In order to solve above-mentioned technical problem, the embodiment of the present disclosure provides a kind of processing method of thread parameter,
The program of the adjustment be applied to voice data recognition result for the method, system or device, as shown in figure 1,
Step s101, creates far call thread corresponding with sub-line journey;
Step s102, when sub-line journey is run, judges whether to need to change the first parameter information in parent process;
Step s103, when judged result is to need to change the first parameter information, calls far call thread;
Step s104, runs far call thread, to change the first parameter information.
When running subprocess, the first parameter information if necessary to modification parent process is it is possible to call and son
Thread corresponding far call thread, then runs this far call thread it is possible to realize not exiting son
Process, do not reenter parent process to change the first parameter information of parent process on the basis of, automatically by
Far call thread is modified to the first parameter information in parent process, to simplify the first parameter of parent process
The modification operation of information, allows subprocess to run without interruption simultaneously, ensures that the fortune of subprocess
Line efficiency and speed.
As shown in Fig. 2 in one embodiment, step s101 can be performed as:
Step a1, processes function by the remote thread in locally created far call thread and creates remotely
Call thread.
The function that far call thread is modified to the parameter information of parent process is mainly processed by remote thread
Function, to realize, therefore, processes, by creating remote thread, the wound that function can complete this far call thread
Build.
In one embodiment, far call thread, before changing the first parameter information, method are being run
Also include:
Parent process is applied for process the internal memory of function for storing the first parameter information and remote thread;And
After successfully applying for internal memory, the first parameter information and remote thread are processed function write parent process.
By applying for processing the internal memory of function for storing the first parameter information and remote thread in parent process,
And after successfully applying for internal memory, the first parameter information and remote thread can be processed function write parent process,
Far call thread can be write parent process, such far call thread is just shared in identical with parent process
Deposit, so that subprocess can change the first parameter information in parent process by far call thread.
In one embodiment, when judged result is to need to change the first parameter information, call far call
Thread, comprising:
When judged result is to need to change the first parameter information, will be with the first parameter information pair by subprocess
The second parameter information answered is transferred to remote thread and processes function to call far call thread;
Run far call thread, to change the first parameter information, comprising:
When remote thread processes function and receives the second parameter information, transported according to the second parameter information
OK, to change the first parameter information.
When needing to change the first parameter information in parent process, will can be believed with the first parameter by subprocess
Cease corresponding second parameter information to be transferred to remote thread process function to call this far call thread, and by
Share identical internal memory in far call thread with parent process, therefore, process function in remote thread and receive
This second parameter information and by second parameter information run after it is possible to directly repair to the first parameter information
Changing, thus realizing not exiting subprocess, not reentering parent process to change the first parameter letter of parent process
On the basis of breath, automatically by far call thread, the first parameter information in parent process can be repaiied
Change, to simplify the modification operation of the first parameter information of parent process, allow subprocess without interruption simultaneously
Run, ensure that operational efficiency and the speed of subprocess.
As shown in figure 3, the present invention also provides a kind of processing meanss of thread parameter, comprising: creation module
301, for creating far call thread corresponding with sub-line journey;
Judge module 302, is configured to, when described sub-line journey is run, judge whether to need to change parent process
In the first parameter information;
Calling module 303, is configured to, when judged result is to need to change described first parameter information, adjust
With described far call thread;
Run module 304, be configured to run described far call thread, to change described first parameter letter
Breath.
As shown in figure 4, in one embodiment, described creation module 301 includes:
Create submodule 3011, be configured to the remote thread in locally created described far call thread
Process function to create described far call thread.
As shown in figure 5, in one embodiment, described device also includes:
Application module 501, is configured to running described far call thread, to change described first parameter
Before information, application in described parent process is configured to store described first parameter information and described remote line
Journey processes the internal memory of function;And
Processing module 502, is configured to after successfully applying for described internal memory, by described first parameter information and
Described remote thread processes function and writes described parent process.
As shown in fig. 6, in one embodiment, described calling module 303 includes:
Transmission submodule 3031, is configured to when judged result is to need to change described first parameter information,
By described subprocess will second parameter information corresponding with described first parameter information be transferred to described long-range
Thread process function is calling described far call thread;
Described operation module 304 includes:
Run submodule 3041, be configured to receive described second parameter in described remote thread process function
During information, run according to described second parameter information, to change described first parameter information.
With regard to the device in above-described embodiment, wherein the concrete mode of unit execution operation is relevant
It has been described in detail in the embodiment of the method, explanation will be not set forth in detail herein.
Finally, the processing meanss of the thread parameter in the present invention are applied to terminal unit.For example, it may be moving
Mobile phone, computer, digital broadcast terminal, messaging devices, game console, tablet device, doctor
Treatment equipment, body-building equipment, personal digital assistant etc..
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or meter
Calculation machine program product.Therefore, the present invention can be using complete hardware embodiment, complete software embodiment or knot
Close the form of the embodiment of software and hardware aspect.And, the present invention can adopt and wherein wrap one or more
Computer-usable storage medium containing computer usable program code (including but not limited to disk memory and
Optical memory etc.) the upper computer program implemented form.
The present invention is to produce with reference to method according to embodiments of the present invention, equipment (system) and computer program
The flow chart of product and/or block diagram are describing.It should be understood that can by computer program instructions flowchart and
/ or block diagram in each flow process and/or the flow process in square frame and flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embed
The processor of formula datatron or other programmable data processing device is to produce a machine so that passing through to calculate
The instruction of the computing device of machine or other programmable data processing device produces for realizing in flow chart one
The device of the function of specifying in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or other programmable datas can be guided to process and set
So that being stored in this computer-readable memory in the standby computer-readable memory working in a specific way
Instruction produce and include the manufacture of command device, the realization of this command device is in one flow process or multiple of flow chart
The function of specifying in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, makes
Obtain and series of operation steps is executed on computer or other programmable devices to produce computer implemented place
Reason, thus the instruction of execution is provided for realizing in flow chart one on computer or other programmable devices
The step of the function of specifying in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
Obviously, those skilled in the art can carry out various changes and modification without deviating from this to the present invention
The spirit and scope of invention.So, if these modifications of the present invention and modification belong to the claims in the present invention
And its within the scope of equivalent technologies, then the present invention is also intended to comprise these changes and modification.
Claims (8)
1. a kind of processing method of thread parameter is it is characterised in that include:
Create far call thread corresponding with sub-line journey;
When described sub-line journey is run, judge whether to need to change the first parameter information in parent process;
When judged result is to need to change described first parameter information, call described far call thread;
Run described far call thread, to change described first parameter information.
2. method according to claim 1 it is characterised in that
Described establishment far call thread corresponding with sub-line journey, comprising:
Created described long-range by the remote thread process function in locally created described far call thread
Call thread.
3. method according to claim 2 it is characterised in that
Running described far call thread, before changing described first parameter information, methods described is also wrapped
Include:
Described parent process is applied for process letter for storing described first parameter information and described remote thread
The internal memory of number;And
After successfully applying for described internal memory, described first parameter information and described remote thread are processed function and writes
Enter described parent process.
4. according to the method in claim 2 or 3 it is characterised in that
Described judged result be need to change described first parameter information when, call described far call line
Journey, comprising:
When judged result is to need to change described first parameter information, will be with described the by described subprocess
It is described remote to call that corresponding second parameter information of one parameter information is transferred to described remote thread process function
Journey calls thread;
The described far call thread of described operation, to change described first parameter information, comprising:
When described remote thread processes function and receives described second parameter information, according to described second parameter
Information is run, to change described first parameter information.
5. a kind of processing meanss of thread parameter are it is characterised in that include:
Creation module, for creating far call thread corresponding with sub-line journey;
Judge module, for when described sub-line journey is run, judging whether to need to change first in parent process
Parameter information;
Calling module, for when judged result is to need to change described first parameter information, calling described remote
Journey calls thread;
Run module, for running described far call thread, to change described first parameter information.
6. device according to claim 5 it is characterised in that
Described creation module includes:
Create submodule, for function is processed by the remote thread in locally created described far call thread
To create described far call thread.
7. device according to claim 6 is it is characterised in that described device also includes:
Application module, for running described far call thread, before changing described first parameter information,
Described parent process is applied for process function for storing described first parameter information and described remote thread
Internal memory;And
Processing module, for after successfully applying for described internal memory, by described first parameter information and described long-range
Thread process function writes described parent process.
8. the device according to claim 6 or 7 it is characterised in that
Described calling module includes:
Transmission submodule, for when judged result is to need to change described first parameter information, by described
Second parameter information corresponding with described first parameter information is transferred to described remote thread process by subprocess
Function is calling described far call thread;
Described operation module includes:
Run submodule, for described remote thread process function receive described second parameter information when,
Run according to described second parameter information, to change described first parameter information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510434676.6A CN106371899A (en) | 2015-07-22 | 2015-07-22 | Thread parameter processing method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510434676.6A CN106371899A (en) | 2015-07-22 | 2015-07-22 | Thread parameter processing method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106371899A true CN106371899A (en) | 2017-02-01 |
Family
ID=57879760
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510434676.6A Pending CN106371899A (en) | 2015-07-22 | 2015-07-22 | Thread parameter processing method and apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106371899A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109254834A (en) * | 2017-07-13 | 2019-01-22 | 普天信息技术有限公司 | A kind of multithreading starting synchronous method |
CN109426571A (en) * | 2017-08-28 | 2019-03-05 | 阿里巴巴集团控股有限公司 | Function call and the method for data access, system, storage medium, processor and device |
CN112256339A (en) * | 2019-07-22 | 2021-01-22 | 百度在线网络技术(北京)有限公司 | Multi-process management method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102004882A (en) * | 2010-11-26 | 2011-04-06 | 北京安天电子设备有限公司 | Method and device for detecting and processing remote-thread injection type Trojan |
CN102841795A (en) * | 2011-06-24 | 2012-12-26 | 镇江华扬信息科技有限公司 | Remote thread injection technology method |
CN103106085A (en) * | 2011-11-15 | 2013-05-15 | 镇江亿海软件有限公司 | Remote thread injection method based on intelligence |
CN104660606A (en) * | 2015-03-05 | 2015-05-27 | 中南大学 | Method for remotely monitoring safety of application program |
-
2015
- 2015-07-22 CN CN201510434676.6A patent/CN106371899A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102004882A (en) * | 2010-11-26 | 2011-04-06 | 北京安天电子设备有限公司 | Method and device for detecting and processing remote-thread injection type Trojan |
CN102841795A (en) * | 2011-06-24 | 2012-12-26 | 镇江华扬信息科技有限公司 | Remote thread injection technology method |
CN103106085A (en) * | 2011-11-15 | 2013-05-15 | 镇江亿海软件有限公司 | Remote thread injection method based on intelligence |
CN104660606A (en) * | 2015-03-05 | 2015-05-27 | 中南大学 | Method for remotely monitoring safety of application program |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109254834A (en) * | 2017-07-13 | 2019-01-22 | 普天信息技术有限公司 | A kind of multithreading starting synchronous method |
CN109254834B (en) * | 2017-07-13 | 2021-05-14 | 普天信息技术有限公司 | Multithreading starting synchronization method |
CN109426571A (en) * | 2017-08-28 | 2019-03-05 | 阿里巴巴集团控股有限公司 | Function call and the method for data access, system, storage medium, processor and device |
CN112256339A (en) * | 2019-07-22 | 2021-01-22 | 百度在线网络技术(北京)有限公司 | Multi-process management method and device, electronic equipment and storage medium |
CN112256339B (en) * | 2019-07-22 | 2023-11-03 | 百度在线网络技术(北京)有限公司 | Multi-process management method, device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105930731B (en) | A kind of method and device of security application TA interaction | |
CN104767809B (en) | A kind of download control method and system | |
CN106371899A (en) | Thread parameter processing method and apparatus | |
CN102904738A (en) | Work order processing method, relevant device and relevant system | |
CN106685894B (en) | Risk identification method, device and system | |
CN108595236A (en) | A kind of method and device for preventing sub-line journey from carrying out operating user interface | |
CN109822549B (en) | Robot programming method and device and controller | |
CN105739956A (en) | Method and system for constructing intelligent rule model of computer system | |
CN107562306A (en) | A kind of method, mobile terminal and storage device for controlling mobile terminal display brightness | |
CN103686303A (en) | Method and device for displaying loading icons | |
CN108733454A (en) | A kind of virtual-machine fail treating method and apparatus | |
CN103813015B (en) | A kind of information processing method and device | |
CN108848410A (en) | Bluetooth audio frequency transmission method, device and computer readable storage medium | |
CN107678863A (en) | The page assembly means of communication and device | |
CN110231962A (en) | Performance configuration method, device, terminal and the storage medium of process | |
CN105933136A (en) | Resource scheduling method and system | |
CN105824533A (en) | Method and device for loading picture and terminal | |
CN103916823B (en) | The creation method and device of mobile phone meeting | |
CN109842892B (en) | NSI PNF updating method, device and computer readable storage medium | |
CN107025126B (en) | Resource scheduling method, NFVO and system | |
CN115242972B (en) | Method and device for calling camera by application, electronic equipment and storage medium | |
CN110244964A (en) | It is a kind of based on O&M application O&M method, O&M method, device and equipment | |
CN108712298A (en) | Upgrading network equipment method, apparatus, the network equipment and storage medium | |
CN109462663A (en) | A kind of method, voice interactive system and storage medium that limitation system resource occupies | |
CN108306961A (en) | A kind of file block method for down loading and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170201 |