CN1801096A - Method and system for implementing thread sleep in computer system - Google Patents

Method and system for implementing thread sleep in computer system Download PDF

Info

Publication number
CN1801096A
CN1801096A CN 200510004029 CN200510004029A CN1801096A CN 1801096 A CN1801096 A CN 1801096A CN 200510004029 CN200510004029 CN 200510004029 CN 200510004029 A CN200510004029 A CN 200510004029A CN 1801096 A CN1801096 A CN 1801096A
Authority
CN
China
Prior art keywords
sleeping
context
hard disk
sleeping process
wrapper
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
Application number
CN 200510004029
Other languages
Chinese (zh)
Other versions
CN100375034C (en
Inventor
过晓冰
王哲鹏
顾光导
苏辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Singapore Pte Ltd
Original Assignee
International Business Machines Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Priority to CNB2005100040298A priority Critical patent/CN100375034C/en
Publication of CN1801096A publication Critical patent/CN1801096A/en
Application granted granted Critical
Publication of CN100375034C publication Critical patent/CN100375034C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a single process dormant-and-arousing method and system in the computer system, wherein the dormant process comprises the following steps: concealing all process windows; suspending all process line-courses; recording all contexts; loading the dormant process file of context; terminating all process dormant; the arousing process comprises the following steps: structuring a packer similar to the context structure in the dormant process; restoring the dormant context; arousing all line-courses in the dormant process; displaying all windows to use the relative process continually. The invention reduces the operation of switch the applying program and optimizes the system resource, which stores the present working environment automatically and restores the entire environment when the accident occurs in the computer.

Description

In computer system, be used for method and system to implementing thread sleep
Technical field
The present invention relates generally to the data processing technique of computer system, especially, the present invention relates in computer system, to be used for method and system implementing thread sleep, and the method and system that sleeping process is waken up.
Background technology
Along with the fast development of infotech, when people go up the various application program of operation at personal computer (PC), can open a plurality of application programs simultaneously often, obviously, the performance that this will take many system resources and can reduce system.Even some application program is in suspended state in system, but these application programs have still taken relevant file (handle) resource, hardware/port/network/image resource, and this still can reduce the performance of computing machine.In addition, when people are reopening application program with the work before continuing, need take a series of action, for example when the copy editor, except opening software for editing, also need to select and open the file of being edited, and drag bar by page turning/rolling and navigate on the edit object of last time, just can work on then, therefore need provide a kind of can be at individual process, application program of having opened for example, the technical scheme of carrying out dormancy solves above-mentioned these problems.
For addressing these problems, some technical solutions are provided in the prior art.Wherein, what just those skilled in the art understood, in a kind of Palm operating system, using a kind of specific hardware platform (for example, can be used as the common storage of internal memory and hard disk), the application program of operation can be freezed.But,, under current hardware condition and operating system, still have the problems referred to above at personal computer (PC) platform.
Once used some solutions at other field, it is similar to solution of the present invention.For instance, below be the example of some correlation techniques and application program:
1, management of process is used, such as the taskmgr.exe among the Windows2000/XP.It can revise the pro-jobs level of process, but the scope of revising only limits to six ranks: in real time (realtime), high (high), be higher than normal (above normal), normal (normal), be lower than normal (below normal) and low (low).Thereby this technology process of ending fully reclaims the resource that all processes take.
2, some softwares can be preserved the scene (scenario) of last work, for example winamp3.exe.But this Technology Need is implemented by the software developer, and present most software all can not be supported this characteristic.
3, some clusters (cluster)/parallel system is supported process implantation technique, for example MOSIX system.But this Technology Need is revised system kernel fully and only can be implemented on multicomputer system.
4, backup/restore application.Present backup/restore application can only be handled static file mirror image.
5, system hibernates technology, this technology can the whole internal memory of snapshot (snapshot) mirror image and described mirror image is saved on the hard disk.But, system's dormancy at be whole computer system, it can not be to the single implementing thread sleep that moves on the computer system.And the system hibernates technology also depends on specific hardware platform, and for example computer power management must be supported ACPI (advanced configuration and power management interface Advanced configuration andPower Interface) etc.
By above description to prior art as can be known, in the prior art, aspect improving resource utilization ratio, improving computing power, existing dormant technology only at be whole computer system, and do not provide the management individual process ability, therefore special for the system that is moving, unpromising its provides high operational performance.
Summary of the invention
For solving problems of the prior art, the method and system that is used for implementing thread sleep of the present invention has been proposed.According to the present invention, can simplify the operation of user when the opening/closing application program, and under system's high load capacity, improve the performance of system, and a kind of method of recovering the real-time working environment is provided.
According to an aspect of the present invention, provide a kind of novel technical scheme to come dormancy and heavy 2 to use (waking up) process (application program of operation).
According to an aspect of the present invention, provide a kind of method that in computer system, is used for implementing thread sleep, may further comprise the steps: all windows of hiding described process; Hang up all threads of described process; Write down the context of described process and the described process context that is write down is carried out unloading as a sleeping process file; And stop described process with to described process dormancy.
According to another aspect of the present invention, a kind of method that sleeping process is waken up of being used in computer system is provided, construct a wrapper similar (Wrapper) to the context mechanism of described sleeping process, wake sleeping process up by carrying out following steps, described step comprises: the context that recovers described sleeping process; Wake all threads of described sleeping process up; And all windows that show described sleeping process use described process with continuation.
According to another aspect of the present invention, provide a kind of system that is used for implementing thread sleep in computer system, having comprised: a first memory that is arranged in internal memory is used for preserving the process context of described process at internal memory; An original read/write driver (RRWD) is used for carrying out alternately with described first memory, carries out following operation and treat sleeping process: all windows of hiding described process; Hang up described process by all threads of hanging up described process; The context of reading and recording described the process therein and described process context that is read carried out unloading as a sleeping process file from described first memory; And stop described process with to described process dormancy; A second memory is arranged in the hard disk of described computer system, is used for preserving the context of the described process that is read from first memory by described RRWD.
According to another aspect of the present invention, provide a kind of system that sleeping process is waken up of being used in computer system, having comprised: a sleeping process file memory is used to preserve the process context of sleeping process; And a wrapper (Wrapper), be used to construct the Wrapper context similar, and be used to carry out following operation: the context that recovers described sleeping process to the context mechanism of described sleeping process; Wake all threads of described sleeping process up; And all windows that show described sleeping process use described process with continuation.
The present invention also provides a kind of user interface that triggers process sleeping/waking/backup/restoration.
In computer system, be used for implementing thread sleep and method and system that sleeping process is waken up according to of the present invention, reduced the operation on the opening/closing application program, thereby and can come free system resources that high performance is provided by the application program of operation is carried out dormancy.And the present invention also can be used for application context backup working time and recovers, and the present invention can preserve current working environment automatically, and can recover entire environment when computing machine breaks down.
Description of drawings
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in detail, thus, it is more obvious that characteristics of the present invention, advantage, purpose and beneficial effect will become, wherein:
Fig. 1 has schematically shown the figure according to the structure between the kernel of prior art in process and operating system;
Fig. 2 has schematically shown the structural drawing according to process sleeping system of the present invention;
Fig. 3 is schematically illustrated in the synoptic diagram of a process transfer deposit receipt contextual process of process of sleeping process;
Fig. 4 has schematically shown according to of the present invention individual process has been carried out the process flow diagram that dormancy is handled;
Fig. 5 has schematically shown according to the present invention in the sleeping process wakeup process, in the step of the essential information of Wrapper recovery sleeping process, and the contextual synoptic diagram of process 1 and Wrapper;
Fig. 6 has schematically shown according to the present invention in the sleeping process wakeup process, and Wrapper recovers in the step of the shared system resource of sleeping process, the contextual synoptic diagram of process 1 and Wrapper;
Fig. 7 has schematically shown according to the present invention in the sleeping process wakeup process, in the step of the user's space content of Wrapper recovery sleeping process, and the contextual synoptic diagram of process 1 and Wrapper;
Fig. 8 has schematically shown according to the present invention in the sleeping process wakeup process, in the step of all thread context of Wrapper recovery sleeping process, and the contextual synoptic diagram of process 1 and Wrapper;
Fig. 9 schematically shows the process flow diagram according to process sleep procedure of the present invention;
Figure 10 schematically shows the process flow diagram according to sleeping process wakeup process of the present invention;
Figure 11 schematically shows the process flow diagram according to process backup procedure of the present invention; And
Figure 12 schematically shows the process flow diagram according to process rejuvenation of the present invention.
Embodiment
Below in conjunction with accompanying drawing preferred implementation of the present invention is described, should be appreciated that, the embodiments described herein only is illustrative effect, those skilled in the art are under instruction of the present invention, can also make amendment to the present invention, conversion, and these modifications or conversion all can not break away from principle of the present invention.
Fig. 1 has schematically shown the figure according to the structure between the kernel of prior art in process and operating system.In the existing computer system, have a plurality of application programs usually and moved simultaneously, the kernel of the application program of operation (process) and computer system carries out alternately, thereby finishes the interactive operations such as transmission, processing of data.
In accompanying drawing 1, schematically shown an individual process, for example process 1.This process context (Process Context) is divided into two parts, and one is the user's space in user model, and another is the process record in kernel mode.
In the system shown in Fig. 1, in user model, for example in the user's space of process 1, comprising: information such as the storehouse of process 1, code and data; One or more dynamic link library/function libraries (DLL/Lib) 110 (Dynamic-Link Library); A kernel interface that is connected with kernel 120, by this kernel interface 120, each process can be carried out with the process recording section 130 in the operating system alternately.In the kernel mode shown in the accompanying drawing 1, comprising: a process recording section 130, wherein write down a plurality of processes, for example process 1, process 2 ... the process record of each among the process n.In the process of the process shown in Fig. 11 record, comprise the resource index 131 of process 1, the essential information 132 of process 1, and the context 133 working time of process 1.Specifically, the essential information 132 of process 1 for example comprises title, parent process, memory database address of process 1 etc.; The resource index 131 of process 1 for example comprises by all shared resources of process, and it is by obtaining the resource index information of described relevant resource occupation alternately with system resource part 135; Write down each the thread TC 1 in the process 1 working time in the context 133, TC 2 ..., the thread context of TC m, for example register value, timer setting, priority or the like.In addition, in kernel mode, also comprise a kernel portion 140 and some drivers 150, wherein in kernel portion 140, for example further can comprise file system management 141, I/O management 142, internal memory/virtual memory management 143... process/thread is managed 144 functional parts such as grade.More than the relevant portion that relates to prior art of the present invention is described, should be understood that for illustrative purposes some simplification have been done by the system shown in the accompanying drawing 1.
According to the present invention, a kind of method and corresponding system that can carry out the dormancy processing to individual process proposed.With reference to the accompanying drawings 2, wherein schematically shown structural drawing according to process sleeping/waking of the present invention system.
In process sleeping/waking according to the present invention system 200, mainly comprise: original read/write driver (RRWD) 230; Wrapper (Wrapper) 240; System interface patch parts (Shell patch SP) 210; Preferably, can also comprise backup/restoration parts (BRC) 250.In this external process sleeping system, also comprise one first external memory storage 240 (for example, the hard disk of support ordinary file system, or the storer on the hard disk), be used to preserve the file of sleeping process; An internal storage 260 (internal memory) has wherein been preserved the process context data that calls for central processing unit (CPU); And external backup storer 270 is as backup database (for example, supporting the hard disk of ordinary file system), is used to preserve the file of the sleeping process of backup.
The following specifically describes according to each functions of components in the process sleeping/waking of the present invention system 200 and the corresponding method step realized.Particularly, below with process 1 be example describe according to of the present invention to individual process dormancy disposal route and corresponding system and the process of dormancy waken up to continue to use the method and the corresponding system of this process.Similarly, the method according to this invention and system can realize a plurality of processes whiles or the dormancy of order implementation process are handled and corresponding process wake up process.
There are three class data to handle.RRWD dumps to hard disk (saving as file) with the process context from internal memory, and, revise the process content to continue to use the process of dormancy.BRC will use backup database to come the process of backup/restoration dormancy.
I, original read/write driver (Raw Read/Write Driver RRWD)
The described original read/write driver 230 of design is a kernel driver according to the present invention, is used to read/revise whole address spaces of all consumer process/threads and hangs up/wake up all consumer process/threads.Described original read/write driver 230 with wherein stored contextual internal storage 260 reciprocations of process, on the one hand, when individual process is carried out sleep operation, the process context data of being preserved in the storer 260 is read, and dump in the storer 240 on the hard disk as the file of a sleeping process, on the other hand, when sleeping process is carried out wake operation, Wrapper context in storer 260 is made amendment to be used for the wake operation of sleeping process, as shown in Figure 2.
Especially, carrying out according to of the present invention when individual process is carried out dormancy and handled, RRWD 230 can be with each process, and for example the file as a sleeping process 1 dumps in the hard disk of computer system process 1 all contexts in internal memory by carrying out following steps.Referring to accompanying drawing 3, wherein be schematically illustrated in the process of sleeping process, the synoptic diagram of contextual process of the process 1 of dormancy is wanted in unloading:
(1) RRWD 230 dumps to all the elements in 1 user's space of the process in the internal memory respectively in the hard disk of computing machine.All the elements in the user's space of process 1 comprise: the code of the storehouse of process 1, process 1, the data of process 1 and process 1 corresponding address in internal memory; Dynamic link library (DLL)/Lib, kernel interface.
(2) RRWD record dumps on the hard disk by shared all resources of process 1 and with it.Wherein, comprise by process 1 all shared resources: the essential information of process 1, for example comprise title, parent process of process 1 etc., and about the resource description of process 1 (for example content of resource index and shared resource).
(3) RRWD arrives hard disk with context spool working time of process 1.Wherein, comprised each the thread TC 1 in the process 1 working time of process 1 in the context, TC2 ..., the thread context of TC m, for example register value, timer setting, priority or the like.
Should be understood that the unloading of above three partial data order on the life period not, can carry out successively, also can carry out simultaneously.
As shown in Figure 3, when individual process being carried out in the process of dormancy, after the step of hard disk, can there be the file of a sleeping process 1 in the context spool of process in the internal memory 1 in hard disk.Comprise in the file of this sleeping process 1:
(1), wherein, title, parent process, memory database address of process 1 etc. have been write down in the essential information of process 1 about the data of process 1 essential information and resource description; And the resource description data of process 1 have comprised the content of resource index and shared resource;
(2) about context data working time of process 1, wherein, context data working time of process 1 has comprised each the thread TC 1 in the process 1, and TC 2 ..., the thread context of TC m, for example register value, timer setting, priority or the like;
(3) data of describing about the user's space of process 1 wherein, as mentioned above, have write down process 1 in all the elements of its user's space and the address that is associated.
In addition, in the process of the process of dormancy being waken up according to the present invention, RRWD can revise the context of Wrapper.It reverts to sleeping process by internally depositing into direct modification of row with context working time of Wrapper.The description that detailed process is described in reference to the Wrapper part is elaborated.
II、Wrapper
Wrapper is a kind of vertical application that is used to carry out to the processing of sleeping process, and it is designed to part and revises its context as target process, comprising process title, user's space, system resource, Thread Count; And utilize RRWD to revise remaining information then, comprise thread context, parent process, priority, and at last remove the Wrapper code and realize wake up process sleeping process from user's space.Wrapper will read the unloading file of sleeping process and when Wrapper moves, and be the context of sleeping process with himself contextual modifications.
Wrapper moves when the user wishes to recover to use sleeping process.As shown in Figure 2, Wrapper and the storer 240 in hard disk carry out alternately, and by the sleeping process file of being preserved in the reference-to storage 240, and the context of Wrapper is set to the context of sleeping process.Its course of work is by carrying out detailed description as described below referring to accompanying drawing 4:
Referring to accompanying drawing 4, wherein show when Wrapper is loaded into internal memory the context mirror image of Wrapper process in internal memory.For simplicity's sake, storehouse, code and the data of Wrapper process constructed according to the invention shown in the single square frame, and are supposed also that here Wrapper has only a thread herein.
Similarly, in the Wrapper context shown in Figure 4, can see that in user model, the user's space of Wrapper also comprises: the storehouse of Wrapper, code and data; And and kernel between kernel interface.And Wrapper is in kernel mode, comprised the shared resource of Wrapper, shared resource index, essential information and working time context.
(1) essential information of recovery sleeping process
Wrapper at first recovers the essential information of process 1 according to the file that dumps to the sleeping process in the hard disk in the process to the individual process dormancy.That is to say,, the essential information of Wrapper is revised as the content of process 1, for example process title according to the content of the sleeping process 1 in the sleeping process file of unloading in the hard disk.
Referring to accompanying drawing 5, wherein schematically shown according to the present invention in the sleeping process wakeup process, in the step of the essential information of Wrapper recovery sleeping process, the contextual synoptic diagram of process 1 and Wrapper.
By this step, can see after comparative drawings figs 4 and accompanying drawing 5: by at first recovering the essential information of process 1, the initial Wrapper context shown in the accompanying drawing 4 becomes the process 1﹠amp shown in the current accompanying drawing 5; The context of Wrapper.
(2) recover the shared system resource of sleeping process
Wrapper is from dumping to the process to the individual process dormancy in the file of the sleeping process in the hard disk, and inquiry is by the shared whole system resources of sleeping process and use the system resource of described sleeping process again.
Referring to accompanying drawing 6, wherein schematically shown according to the present invention in the sleeping process wakeup process, Wrapper recovers in the step of the shared system resource of sleeping process, the contextual synoptic diagram of process 1 and Wrapper.
By this step, after comparative drawings figs 5 and accompanying drawing 6, can further obtain: at the process 1﹠amp shown in the accompanying drawing 6; In the context of Wrapper, the initial shared system resource of Wrapper has become the shared system resource of sleeping process 1, and the resource index among the initial Wrapper also become the resource index of sleeping process 1.
In addition, preferably,, then point out user's fault and withdraw from wakeup process sleeping process if current system can not satisfy the demand of whole resource application.
(3) user's space of recovery sleeping process
Wrapper finds out the idle address space in the user's space of sleeping process, and current code is moved to idle address space.
Except that the kernel interface module,, read all the elements in the user's space of sleeping process and cover on the corresponding address of Wrapper user's space from process, dumping in the file of the sleeping process in the hard disk to the individual process dormancy.
Referring to accompanying drawing 7, wherein schematically shown according to the present invention in the sleeping process wakeup process, in the step of the user's space content of Wrapper recovery sleeping process, the contextual synoptic diagram of process 1 and Wrapper.
By this step, after comparative drawings figs 6 and accompanying drawing 7, can further obtain: at the process 1﹠amp shown in the accompanying drawing 7; In the context of Wrapper, the most contents of sleeping process 1 under user model, for example storehouse of process 1, code, data, and the content of the DLL/Lib of process 1 has all obtained recovery.
(4) thread context of recovery sleeping process
In this step, Wrapper dumps in the file of the sleeping process in the hard disk from the process to the individual process dormancy, reads the number of threads of sleeping process 1, and starts identical number of threads.
Then, Wrapper hangs up all threads to system's application, comprises main thread.
After this step, the context of Wrapper is partly reverted to the context of sleeping process.Then, RRWD is the contextual modifications of each thread the context of dormancy thread, and recovers some key messages, for example parent process etc.
Last step is to remove the content of Wrapper from user's space.At this moment, originally the process context of Wrapper is replaced by the context of process 1 fully, and i.e., the sleeping process context is recovered fully.If all threads of RRWD wakeup process 1, then sleeping process will be continued to use.
Referring to accompanying drawing 8, wherein schematically shown according to the present invention in the sleeping process wakeup process, in the step of all thread context of Wrapper recovery sleeping process, the contextual synoptic diagram of process 1 and Wrapper.
By this step, after comparative drawings figs 7 and accompanying drawing 8, can further obtain: at the process 1﹠amp shown in the accompanying drawing 8; In the context of Wrapper, initially only have a thread and return to and realize that sleeping process 1 all threads are recovered fully by Wrapper.That is to say, after the step of finishing accompanying drawing 8, realized waking up and can make sleeping process after obtaining waking up, be continued to use sleeping process.
III backup/restoration parts (Backup ﹠amp; Restore Component BRC)
In a preferred embodiment of the invention, can also comprise backup/restoration parts (BRC), be used for preserving all process contexts automatically with cycle regular hour, so that computer system break down or the situation of closing unusually under, the content that can utilize the latest content of the process of being preserved to come recovering process or sleeping process.These parts can trigger by timer or User Preferences (preference), and for example, it will call RRWD every five minutes automatically to preserve all process contexts.When computer starting, if last the closing of computing machine is unusual, computer crashes and when restarting for example, then it can recover last all contexts of process of preserving according to user's setting.
As shown in Figure 2, BRC and storer 240 carry out alternately, are saved in automatically in the backup database 270 with the sleeping process file that will dump in process dormancy processing procedure in the hard disk at interval at regular intervals.
IV.Shell Patch (system interface patch) (SP).
SP is the patch (patch) of desktop platform that is used for call back function (call back) function of Linux (for example Gnome) or Windows Explorer (form browser).It concentrates in user interface (UI) design: can be when the user imports hot key (for example " Alt-F5 "), triggering is used for the dormancy of current process to be handled, and if the user import another hot key (for example " Ctrl-Tab ") then can list all sleeping process in the hard disk.It increases by one in Shell will trigger the context menu item that continues to use the appointment process.
Refer again to accompanying drawing 2, SP provides interface mutual between process sleeping system and the operating system.By described SP, the user can select to treat the process of dormancy or process to be waken up; When the user selected certain to wait to have a holiday process, SP was by calling RRWD to implementing thread sleep; When the user selected to treat wakeup process, SP woke up to continue use sleeping process by selecting Wrapper and RRWD, and when needs backed up all process contexts, SP came backup process etc. by selecting BRC.
Below by with reference to the accompanying drawings 2 and in conjunction with the accompanying drawings the process flow diagram of 9-12 concrete steps according to process sleeping/waking process of the present invention are described.
Accompanying drawing 9 schematically shows the process flow diagram according to process sleep procedure of the present invention.Referring to accompanying drawing 9, at first when the process sleep procedure that starts individual process, in step S905, RRWD will hide all windows that (minimizing) specifies the process that will carry out dormancy.Then, in step S910, RRWD should the appointment process hang up by all threads of hanging up this process.Then in step S915, RRWD will specify the context spool of process of dormancy in the hard disk of computing machine.Particularly, in this step, RRWD dumps to the context of following appointment sleeping process in the hard disk of computing machine: (1) dumps to all the elements in the user's space of appointment process in the internal memory in the hard disk of computing machine, for example, all the elements in the user's space of appointment process comprise: storehouse, code, the data of specifying process; Dynamic link library (DLL)/Lib, kernel interface.(2) inquiry dumps on the hard disk by shared all resources of appointment process and with it.Wherein, all resources shared by the appointment process comprise: the essential information of specifying process, for example comprise the title, parent process, address space inlet of appointment process etc., and about specifying the resource description of process, for example the content of resource index and shared resource.(3) will specify the process status information of process, for example working time, context spool was to hard disk.Wherein, comprised each the thread TC 1 in the process described working time in the context, TC 2 ..., the thread context of TC m, for example register value, timer setting, priority or the like.At last, in step S920, stop this process, i.e. process dormancy success, and discharge all shared resources of this appointment process.
Accompanying drawing 10 schematically shows the process flow diagram according to sleeping process wakeup process of the present invention.Referring to accompanying drawing 10, the simple course of work of sleeping process wakeup process is as follows.In step S1005, Wrapper will recover the sleeping process context.In the contextual step of described recovery sleeping process, further comprise following substep: (1) recovers the essential information of sleeping process.That is to say, according to the content of the sleeping process in the sleeping process file of unloading in the hard disk, revise its essential information, for example the process title; (2) recover the shared system resource of sleeping process; (3) user's space of recovery sleeping process; (4) the time context that resumes operation comprises the context of each thread; (5) recover other essential information, for example parent process (if available); And (6) RRWD removes the Wrapper code by discharging the shared address area of Wrapper from user's space.Then, after successfully realizing the contextual step of described recovery sleeping process, in step S1010, RRWD will wake this sleeping process up.And in step S1015, RRWD will show all windows of sleeping process at last.Thus, successfully realized waking up to sleeping process.
Accompanying drawing 11,12 schematically shows the process flow diagram according to process backup/restoration process of the present invention.This process backup/restoration process is the additional and expanded function of process sleep procedure preferably, it is in the process of the process of carrying out dormancy, automatically the content that will dump in the process sleep procedure on the hard disk is carried out automated back-up by certain time interval, and computer system break down or the situation of closing unusually under, the content that can utilize the latest content of the process of being preserved to come recovering process or sleeping process.
Referring to accompanying drawing 11, the simple course of work of process backup is as follows:
At first, in step S1105, carry out calling to the process sleep procedure.In this step, be actually process has been carried out process dormancy all processes (Fig. 9 description).Next, in step S1110, the process unloading file that BRC will preserve on hard disk and backup in the nonvolatile memory by the All Files that process is opened.And, computer run break down or the situation of closing unusually under, in step S1115, the calling process wakeup process, promptly the process described of Figure 10 successfully realizes backup thus.
Accompanying drawing 12 schematically shows the process flow diagram according to process rejuvenation of the present invention.Referring to accompanying drawing 12, the simple process process that process is recovered is as follows:
At first in step S1205, BRC will duplicate All Files to the original position from backup database, and it is with Overwrite existing files.That is to say the All Files that the process unloading file on the recovery hard disk and this process are opened.
Then, in step S1210, BRC is by the calling process wakeup process, i.e. the process of Figure 10 description is come recovering process.
Below in conjunction with the accompanying drawings, each embodiment of method and system according to the process sleeping/waking that the present invention is directed to individual process is described in detail, but above these embodiment only are examples, and those skilled in the art can make variations and modifications within the spirit and scope of the present invention.Therefore, the invention is not restricted to these embodiment, scope of the present invention is limited by the claim of enclosing and is as the criterion.

Claims (23)

1, a kind of method that is used in computer system implementing thread sleep may further comprise the steps:
Hide all windows of described process;
Hang up all threads of described process;
Write down the context of described process and the described process context that is write down is carried out unloading as a sleeping process file; And
Stop described process with to described process dormancy.
2, according to the method for being used for of claim 1, further comprise implementing thread sleep, with the described process context spool that write down step, comprising following substep to hard disk:
All the elements in the user's space of the described process that writes down in the internal memory are dumped in the hard disk of computing machine;
All resources that the described process that writes down in the internal memory is shared dump on the hard disk;
With the described process that writes down in the internal memory working time context spool in hard disk.
3, according to the method to implementing thread sleep of being used for of claim 2, wherein, the substep in the described hard disk that all the elements in the user's space of the described process that writes down in the internal memory is dumped to computing machine comprises:
Will be about storehouse, code and the data of described process, the content of dynamic link library (DLL)/Lib and kernel interface dumps in the hard disk of computing machine.
4, according to the method to implementing thread sleep of being used for of claim 2, wherein, the substep that described all resources that the described process that writes down in the internal memory is shared dump on the hard disk comprises:
Dump on the hard disk with the essential information of described process and about the resource description of described process, wherein, the essential information of described process comprises title, parent process, the address space inlet of described process, and the resource description of described process comprises the content of the resource that resource index and described process are shared.
5, according to the method to implementing thread sleep of being used for of claim 2, wherein, described context spool working time with the described process that writes down in the internal memory comprises to the substep in the hard disk:
The thread context of each thread in the described process is dumped in the hard disk, and wherein said thread context comprises: register value, timer setting, priority etc.
6, according to the method for being used for of claim 1, further comprise implementing thread sleep:
At a certain time interval, with the step in described sleeping process file automated back-up to a database that dumps to the described process in the hard disk.
7, according to the method for being used for of claim 1, further comprise implementing thread sleep:
For the user provides the tabulation of running process, be used for selecting to treat the process of dormancy by the user.
8, a kind of method that sleeping process is waken up of being used in computer system is constructed a wrapper similar to the context mechanism of described sleeping process (Wrapper), wakes sleeping process up by carrying out following steps, and described step comprises:
Recover the context of described sleeping process;
Wake all threads of described sleeping process up; And
All windows that show described sleeping process are to continue to use described process.
9, according to Claim 8 be used for method that sleeping process is waken up, further comprise:
According to the sleeping process file that dumps in the process sleep procedure in the hard disk, by carrying out the context that following substep recovers described sleeping process, described substep comprises by described Wrapper:
Recover the essential information of sleeping process;
Recover the shared system resource of sleeping process; And
Recover the user's space of sleeping process.
10, according to Claim 8 be used for method that sleeping process is waken up, further comprise:
According to the sleeping process file that dumps in the process sleep procedure in the hard disk, by carrying out all threads that following substep wakes described sleeping process up, described substep comprises by described Wrapper:
Read the Thread Count of described sleeping process in the sleeping process file from dump to hard disk;
According to the number of sleeping process, revise the number of threads of described Wrapper.
11, according to Claim 8 be used for method that sleeping process is waken up, also comprise:
When computer system breaks down or shut down computer unusually system, call the step of the sleeping process file that is stored in a described sleeping process in the backup database.
12, according to Claim 8 be used for method that sleeping process is waken up, further comprise:
For the user provides the tabulation of sleeping process, be used for selecting process to be waken up by the user.
13, a kind of system that is used in computer system implementing thread sleep comprises:
A first memory that is arranged in internal memory is used for preserving the process context of described process at internal memory;
An original read/write driver (RRWD) is used for carrying out alternately with described first memory, carries out following operation and treat sleeping process:
Hide all windows of described process;
Hang up described process by all threads of hanging up described process;
The context of reading and recording described the process therein and described process context that is read carried out unloading as a sleeping process file from described first memory; And
Stop described process with to described process dormancy;
A second memory is arranged in the hard disk of described computer system, is used for preserving the context of the described process that is read from first memory by described RRWD.
14, according to the system of being used for of claim 13 to implementing thread sleep, wherein dispose described RRWD with carry out following operation with the described process context spool that write down to hard disk, described operation comprises:
All the elements in the user's space of the described process that writes down in the internal memory are dumped in the hard disk of computing machine;
All resources that the described process that writes down in the internal memory is shared dump on the hard disk;
With the described process that writes down in the internal memory working time context spool in hard disk.
15, according to the system of being used for of claim 13 to implementing thread sleep, wherein to dispose described RRWD and all the elements in the user's space of the described process that writes down in the internal memory are dumped in the hard disk of computing machine to carry out following operation, described operation comprises:
Will be about storehouse, code and the data of described process, the content of dynamic link library (DLL)/Lib and kernel interface dumps in the hard disk of computing machine.
16, according to the system of being used for of claim 13 to implementing thread sleep, wherein to dispose described RRWD and all shared resources of process described in the internal memory are dumped on the hard disk to carry out following operation, described operation comprises:
Dump on the hard disk with the essential information of described process and about the resource description of described process, wherein, the essential information of described process comprises title, parent process, the memory headroom entry address of described process, and the resource description of described process comprises the content of the resource that resource index and described process are shared.
17, according to the system of being used for of claim 13 to implementing thread sleep, wherein dispose described RRWD with carry out following operation with described process working time context spool in hard disk, described operation comprises:
The thread context of each thread in the described process is dumped in the hard disk, and wherein said thread context comprises: register value, timer setting, priority etc.
18, according to the system of being used for of claim 13, further comprise implementing thread sleep:
Backup/restoration parts (BRC) are used at a certain time interval, and automated back-up dumps to the sleeping process file of the described process in the hard disk; And
A backup database is used to preserve the sleeping process file that is backed up by described backup/restoration parts.
19, according to the system of being used for of claim 13, further comprise implementing thread sleep:
A user interface that is connected with computer system is used to provide the running process tabulation to select to treat sleeping process for the user.
20, a kind of system that sleeping process is waken up of being used in computer system comprises:
A sleeping process file memory is used to preserve the process context of sleeping process; And
A wrapper (Wrapper) is used to construct the Wrapper context similar to the context mechanism of described sleeping process, and is used to carry out following operation:
Recover the context of described sleeping process;
Wake all threads of described sleeping process up; And
All windows that show described sleeping process are to continue to use described process.
21, according to the system that sleeping process is waken up of being used for of claim 20, further comprise:
According to the sleeping process file of being preserved in the sleeping process file memory, by carrying out the context that following operation recovers described sleeping process, described operation comprises by described Wrapper:
Recover the essential information of sleeping process;
Recover the shared system resource of sleeping process; And
Recover the user's space of sleeping process.
22, according to the system that sleeping process is waken up of being used for of claim 20, further comprise:
A backup database is used to preserve the contextual backup file of process of described sleeping process;
Backup/restoration parts (BRC) are used for calling the backup sleeping process file of the described sleeping process that is stored in the described backup database when computer system breaks down or shut down computer unusually system.
23, according to the system that sleeping process is waken up of being used for of claim 22, further comprise:
A user interface that is connected with computer system is used to provide sleeping process tabulation to select to treat wakeup process for the user.
CNB2005100040298A 2005-01-05 2005-01-05 Method and system for implementing thread sleep in computer system Expired - Fee Related CN100375034C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100040298A CN100375034C (en) 2005-01-05 2005-01-05 Method and system for implementing thread sleep in computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100040298A CN100375034C (en) 2005-01-05 2005-01-05 Method and system for implementing thread sleep in computer system

Publications (2)

Publication Number Publication Date
CN1801096A true CN1801096A (en) 2006-07-12
CN100375034C CN100375034C (en) 2008-03-12

Family

ID=36811125

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100040298A Expired - Fee Related CN100375034C (en) 2005-01-05 2005-01-05 Method and system for implementing thread sleep in computer system

Country Status (1)

Country Link
CN (1) CN100375034C (en)

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101866301A (en) * 2009-04-14 2010-10-20 佳能株式会社 The control method of signal conditioning package and signal conditioning package
CN102388370A (en) * 2009-06-19 2012-03-21 核心科技有限公司 Computer process management
CN102436405A (en) * 2011-09-05 2012-05-02 北京星网锐捷网络技术有限公司 Saving method and device as well as tempering detection method and device for process context
CN102467404A (en) * 2011-10-14 2012-05-23 海尔集团技术研发中心 Method for achieving software fast handover based on physical internal storage and device thereof
CN102467403A (en) * 2011-10-14 2012-05-23 海尔集团技术研发中心 Software fast switching method based on progress emigration/immigration and device thereof
CN102754058A (en) * 2009-07-20 2012-10-24 惠普发展公司,有限责任合伙企业 Selective hibernation of activities in an electronic device
CN102902582A (en) * 2011-09-12 2013-01-30 微软公司 Managing processes within suspend states and execution states
CN102999384A (en) * 2011-09-12 2013-03-27 微软公司 Managing processes within suspend states and execution states
CN103226481A (en) * 2012-01-27 2013-07-31 辉达公司 Automatic dependent task launch
CN103257700A (en) * 2012-02-20 2013-08-21 联想(北京)有限公司 Energy saving method and energy saving device for Android system
CN103678040A (en) * 2013-12-06 2014-03-26 北京明朝万达科技有限公司 Snapshooting and backspacing method and system based on computer system
CN103927226A (en) * 2013-01-15 2014-07-16 晨星软件研发(深圳)有限公司 Electronic device dormancy response setting method and electronic device
CN103975308A (en) * 2011-12-13 2014-08-06 索尼电脑娱乐公司 Information processing device, information processing method, program, and information storage medium
CN104331463A (en) * 2014-10-30 2015-02-04 深圳市锐明视讯技术有限公司 Method and device for realizing multithreading of file system
CN105302662A (en) * 2014-07-25 2016-02-03 腾讯科技(深圳)有限公司 Multi-machine backup method and system
CN105677407A (en) * 2008-09-09 2016-06-15 联想(北京)有限公司 Application program closing method and device
CN106020976A (en) * 2016-05-13 2016-10-12 北京百度网讯科技有限公司 Method and apparatus for offloading out of memory processing process to user space
CN103197962B (en) * 2012-01-04 2017-02-08 中国移动通信集团公司 Multi-process state switching method and device
US9671816B2 (en) 2011-08-10 2017-06-06 Microsoft Technology Licensing, Llc Suspension and/or throttling of processes for connected standby
US9952897B2 (en) 2011-09-12 2018-04-24 Microsoft Technology Licensing, Llc Managing processes within suspend states and execution states
WO2018141166A1 (en) * 2017-02-03 2018-08-09 Huawei Technologies Co., Ltd. Methods and systems for hibernation of processes in computing devices
CN109426563A (en) * 2017-08-31 2019-03-05 华为技术有限公司 A kind of process management method and device
CN109491836A (en) * 2018-10-30 2019-03-19 京信通信系统(中国)有限公司 Data reconstruction method, device and base station
CN112486713A (en) * 2019-09-11 2021-03-12 华为技术有限公司 Screen freezing processing method and electronic equipment
CN112732238A (en) * 2020-12-28 2021-04-30 上海微盟企业发展有限公司 JS-based execution context acquisition method and related device
CN115113774A (en) * 2022-06-28 2022-09-27 上海中汇亿达金融信息技术有限公司 Screen locking and unlocking method and related device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3106401B2 (en) * 1993-07-26 2000-11-06 インターナショナル・ビジネス・マシーンズ・コーポレ−ション Information processing system
CN1255729C (en) * 1999-08-02 2006-05-10 神达电脑股份有限公司 Repeatable 'temporary suspending-restarting' method for system
US6944790B2 (en) * 2001-04-05 2005-09-13 International Business Machines Corporation System and method for collecting and restoring user environment data using removable storage
JP2003345456A (en) * 2002-05-28 2003-12-05 Matsushita Electric Ind Co Ltd Interrupt processing method in computer system
US20040025045A1 (en) * 2002-07-30 2004-02-05 Sentry Technologies Pte, Ltd. Method for switching rapidly between computing modes
CN1285990C (en) * 2003-03-12 2006-11-22 联想(北京)有限公司 Method for saving and restoring computer system operation state

Cited By (44)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9274807B2 (en) 2006-04-20 2016-03-01 Qualcomm Incorporated Selective hibernation of activities in an electronic device
CN105677407A (en) * 2008-09-09 2016-06-15 联想(北京)有限公司 Application program closing method and device
CN105677407B (en) * 2008-09-09 2019-01-15 联想(北京)有限公司 Closing application program method and apparatus
CN101866301A (en) * 2009-04-14 2010-10-20 佳能株式会社 The control method of signal conditioning package and signal conditioning package
CN101866301B (en) * 2009-04-14 2014-08-06 佳能株式会社 Information processing apparatus and method for controlling information processing apparatus
CN102388370A (en) * 2009-06-19 2012-03-21 核心科技有限公司 Computer process management
US10268358B2 (en) 2009-07-20 2019-04-23 Qualcomm Incorporated Selective hibernation of activities in an electronic device
CN102754058A (en) * 2009-07-20 2012-10-24 惠普发展公司,有限责任合伙企业 Selective hibernation of activities in an electronic device
US10901602B2 (en) 2009-07-20 2021-01-26 Qualcomm Incorporated Selective hibernation of activities in an electronic device
US11500532B2 (en) 2009-07-20 2022-11-15 Qualcomm Incorporated Selective hibernation of activities in an electronic device
US10877657B2 (en) 2009-07-20 2020-12-29 Qualcomm Incorporated Selective hibernation of activities in an electronic device
US9671816B2 (en) 2011-08-10 2017-06-06 Microsoft Technology Licensing, Llc Suspension and/or throttling of processes for connected standby
CN102436405A (en) * 2011-09-05 2012-05-02 北京星网锐捷网络技术有限公司 Saving method and device as well as tempering detection method and device for process context
CN102436405B (en) * 2011-09-05 2016-03-30 北京星网锐捷网络技术有限公司 A kind of process context preservation, altering detecting method and device
CN102999384A (en) * 2011-09-12 2013-03-27 微软公司 Managing processes within suspend states and execution states
US9588576B2 (en) 2011-09-12 2017-03-07 Microsoft Technology Licensing, Llc Managing processes within suspend states and execution states
US9952897B2 (en) 2011-09-12 2018-04-24 Microsoft Technology Licensing, Llc Managing processes within suspend states and execution states
CN102902582A (en) * 2011-09-12 2013-01-30 微软公司 Managing processes within suspend states and execution states
CN102999384B (en) * 2011-09-12 2017-05-17 微软技术许可有限责任公司 Managing processes within suspend states and execution states
CN102902582B (en) * 2011-09-12 2015-08-05 微软技术许可有限责任公司 Managing process in suspended state and executing state
CN102467404A (en) * 2011-10-14 2012-05-23 海尔集团技术研发中心 Method for achieving software fast handover based on physical internal storage and device thereof
CN102467403A (en) * 2011-10-14 2012-05-23 海尔集团技术研发中心 Software fast switching method based on progress emigration/immigration and device thereof
CN103975308B (en) * 2011-12-13 2019-07-19 索尼电脑娱乐公司 Information processing equipment, information processing method, program and information storage medium
CN103975308A (en) * 2011-12-13 2014-08-06 索尼电脑娱乐公司 Information processing device, information processing method, program, and information storage medium
CN103197962B (en) * 2012-01-04 2017-02-08 中国移动通信集团公司 Multi-process state switching method and device
CN103226481A (en) * 2012-01-27 2013-07-31 辉达公司 Automatic dependent task launch
CN103257700B (en) * 2012-02-20 2016-08-17 联想(北京)有限公司 The power-economizing method of a kind of android system and device
CN103257700A (en) * 2012-02-20 2013-08-21 联想(北京)有限公司 Energy saving method and energy saving device for Android system
CN103927226A (en) * 2013-01-15 2014-07-16 晨星软件研发(深圳)有限公司 Electronic device dormancy response setting method and electronic device
CN103678040A (en) * 2013-12-06 2014-03-26 北京明朝万达科技有限公司 Snapshooting and backspacing method and system based on computer system
CN105302662A (en) * 2014-07-25 2016-02-03 腾讯科技(深圳)有限公司 Multi-machine backup method and system
CN104331463B (en) * 2014-10-30 2018-07-17 深圳市锐明技术股份有限公司 A kind of method and device that file system multithreading is realized
CN104331463A (en) * 2014-10-30 2015-02-04 深圳市锐明视讯技术有限公司 Method and device for realizing multithreading of file system
CN106020976A (en) * 2016-05-13 2016-10-12 北京百度网讯科技有限公司 Method and apparatus for offloading out of memory processing process to user space
CN106020976B (en) * 2016-05-13 2018-06-01 北京百度网讯科技有限公司 Memory is exhausted into the method and apparatus that process flow is unloaded to user's space
US10228966B2 (en) 2017-02-03 2019-03-12 Huawei Technologies Co., Ltd. Methods ad systems for hibernation of processes in computing devices
WO2018141166A1 (en) * 2017-02-03 2018-08-09 Huawei Technologies Co., Ltd. Methods and systems for hibernation of processes in computing devices
CN109426563A (en) * 2017-08-31 2019-03-05 华为技术有限公司 A kind of process management method and device
CN109491836A (en) * 2018-10-30 2019-03-19 京信通信系统(中国)有限公司 Data reconstruction method, device and base station
CN112486713A (en) * 2019-09-11 2021-03-12 华为技术有限公司 Screen freezing processing method and electronic equipment
CN112732238A (en) * 2020-12-28 2021-04-30 上海微盟企业发展有限公司 JS-based execution context acquisition method and related device
CN112732238B (en) * 2020-12-28 2024-02-20 上海微盟企业发展有限公司 JS-based execution context acquisition method and related device
CN115113774A (en) * 2022-06-28 2022-09-27 上海中汇亿达金融信息技术有限公司 Screen locking and unlocking method and related device
CN115113774B (en) * 2022-06-28 2023-10-24 上海中汇亿达金融信息技术有限公司 Screen locking and unlocking method and related device

Also Published As

Publication number Publication date
CN100375034C (en) 2008-03-12

Similar Documents

Publication Publication Date Title
CN1801096A (en) Method and system for implementing thread sleep in computer system
US8875160B2 (en) Dynamic application migration
CN102272734B (en) Method and system for hibernation or suspend using a non-volatile-memory device
CN1208721C (en) Graded task switching method based on PowerPC processor structure
TWI617914B (en) Specialized boot path for speeding up resume from sleep state
JP4177960B2 (en) Incremental unnecessary information collection
JP6370218B2 (en) MEMORY MANAGEMENT METHOD, COMPUTER SYSTEM, COMPUTER PROGRAM, AND STORAGE MEDIUM
WO2012161777A2 (en) Multi-phase resume from hibernate
CN100342342C (en) Java virtual machine implementation method supporting multi-process
JP5980916B2 (en) Computer-implemented method and computer system
CN102841674B (en) Embedded system based on novel memory and hibernation and awakening method for process of embedded system
CN1977246A (en) Method, software and apparatus for using application state history information when re-launching applications
CN100538641C (en) The method of operation calculation device
CN1818869A (en) Mirror starting optimization of built-in operation system
CN1825283A (en) Method for implementing hardware image starting optimizing of embedded operating system
JP2014520346A (en) Computer-implemented method and computer system
CN1097237C (en) Information processing system
CN1097236C (en) Information processing system
CN101894049A (en) System and method for recycling garbage object in self-adaptive way
CN1648878A (en) Method for improving compute system disc synchronous writing property based on movable memory
CN1959643A (en) Apparatus, system, and method for reassigning a client
CN101046761A (en) Device and method for fetching snapshot data
CN1991776A (en) Protection method for caching data of memory system
CN100339828C (en) Method and device for realizing rapid start
CN102736928A (en) Method for fast resuming computer system and computer system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: LIAN XIANG(SINGAPORE)PRIVATE LTD.

Free format text: FORMER OWNER: INTERNATIONAL BUSINESS MACHINE CORP.

Effective date: 20061027

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20061027

Address after: Singapore Changi

Applicant after: Lenovo (Singapore) Pte. Ltd.

Address before: New York, USA

Applicant before: International Business Machines Corp.

C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080312

Termination date: 20210105

CF01 Termination of patent right due to non-payment of annual fee