Background technology
At present, processor has entered the multi-core/many-core epoch, but current operating system is only with symmetric multiprocessor (Symmetric Multi-Processing, SMP) mode uses multi-core/many-core processor, can not make full use of the parallel processing capability of multi-core/many-core processor.Experiment proves, when processor is more than 16 cores, the performance of existing Linux no longer linear increase reduces on the contrary.Therefore, be necessary to design a kind of new operating system.
Mach (Microkernel Operating System) structure, be the eighties in 20th century Later development get up.An outstanding thought in modern operating system design composition more in operating system and function is put in higher level (and user model) go to run, and stay next as far as possible little kernel, carry out the most basic Core Feature of complete operation system with it, this technology is called as Microkernel.The design object of micro-kernel is separated the basic operation rule of the realization of system service and system, and many system services are put into the process of separation by micro-kernel, as file system, and device driver, and process is served by Message Transmission calling system.These very modular User space services are used for operation advanced in complete operation system, and such design makes the design of meat and potatoes in kernel simpler.Makeing mistakes of a serviced component can't cause the collapse of whole system, and kernel needs do, and are only restart this assembly, and need not affect other part.
Operating system based on micro-kernel has following feature:
1) enough little kernel
In Mach, kernel refers to well-designed, to realize the most basic Core Feature of modern OS part.Micro-kernel is not a complete OS, and is meat and potatoes in operating system, and it is generally used for:
Realize the process be closely related with hardware;
Realize the function that some are more basic;
Be responsible for the communication between client and server.
They just provide an important foundation for building general purpose O S, and operating system nucleus so just can be guaranteed to do very little.Like this, on many core platforms, can simultaneously at the upper operation kernel kernel example of each central processing unit (Central Processing Unit, CPU), each CPU does not interfere with each other when entering kernel state, avoids multiple CPU to fight for the performance consumption of kernel lock generation.
2) based on Client/Server
Meat and potatoes in operating system is put into kernel, and realizes during most functions of operating system are all placed on outside micro-kernel one group of server.These system services are all realized by as process, operate in User space.Because the address space between User space process is isolation, so cannot directly communicate between different process under normal circumstances.Once need to call between different process, such as, calling between consumer process and system service, system service is all that the message passing mechanism that provides by micro-kernel is to realize information interaction.So In the view of user, this is a kind of pattern of similar client/server, and user sends request to kernel, and the service of interior nuclear control corresponding system is served.
Existing micro-kernel generally only provides basic hardware operation interface, and the function that all operations system (Operating System, OS) must provide is provided by the form of system service by it, and different system services operates in User space; System service is isolated each other, even if certain system service occurs extremely also can not interfering with other modules; Mode by interprocess communication (Inter Process Communication, IPC) between system service and system service works.
Existing Mach is all based on CLIENT/SERVER MODEL, consumer process needs to use a kind of system service by the notice OS that sends a request message to OS, dispatches corresponding system service complete primary system service after OS receives request message according to the situation of self.Usual user writes oneself application program, the built-in function that some systems provide can be used, these storehouses provide the interface of packaged system service mostly, user only needs the needs according to oneself, fill in relevant parameter, just sensuously can directly have invoked some system services, before said functional steps be all completed by OS.Fig. 1 illustrates the process that monokaryon platform uses primary system to serve.
On many core platforms, owing to there is multiple kernel example simultaneously, each CPU runs an independently kernel example, and each kernel example each other can not interfering with an opponent, and each process of User space can arbitrarily be run by each kernel example simultaneously.In this case also will consider that each process may not on same kernel, at this moment sending message needs to use intercore communication.Internuclear transmission message needs to open a proxy module (monitor) on each kernel, all message is first pooled to agency, the position of proxy lookups target core, is sent to opposite end monitor by message from local monitor, then is sent to opposite end target process by opposite end monitor.So the process that usual user uses primary system to serve as shown in Figure 2, can be summed up as following step:
1) consumer process assembles a message, and message is sent to kernel;
2) kernel sends a message to local monitor;
3) local monitor searches the position of target core, and message is mail to opposite end monitor;
4), after opposite end monitor receives message, message is mail to system service;
5) system service work;
6), after system service is finished the work, execution result is mail to opposite end monitor;
7) execution result is mail to local monitor by opposite end monitor;
8), after local monitor receives execution result, consumer process is issued.
From said process, can find out, the service degraded performance of existing Mach.Compared with grand kernel operating system, complete same primary system service, the expense of micro-kernel is more than grand kernel several times even more.
The system service that all OS of grand kernel operating system (for Linux) provides all is programmed in kernel module with code, the process completed required for primary system service is that user program is absorbed in kernel, then served by kernel executive system, after completing, return User space from kernel state.Expense is only 2 contextual processing.And Mach, as shown in Figure 2, complete and once call required expense normally 8 contextual processing and 2 intercore communication.If system service needs mutually to call, grand kernel can complete directly calling of difference in functionality module in kernel, and microkernel designs just needs the mode using message communicating, CPU is switched back and forth between the different system service being in User space, the expense that intercore communication and contextual processing bring is very large, and performance issue is just more serious.
Summary of the invention
Embodiments provide the communication means between a kind of consumer process and system service, device, being intended to solve prior art makes CPU being in the consumer process of User space with when communicating between system service, the expense that intercore communication and contextual processing bring is very large, the problem that performance issue is just more serious.
First aspect, communication means between a kind of consumer process and system service is provided, be applied to multi-core platform, described multi-core platform comprises at least one first physics core and at least one the second physics core, described first physics core runs and has the first kernel, described first kernel runs and has first agent's module and one or more consumer process, described second physics core runs and has the second kernel, described second kernel runs and has second agent's module and system service, described first agent's module is preserved the shared drive address information that described system service and described consumer process are shared, described method comprises:
Described consumer process sends the first request by the first kernel to described first agent's module, carries the first data that described consumer process needs described system service process in described first request;
After described first agent's module receives the first request, by described first kernel, described first data of carrying in described first request are written to first memory headroom corresponding with the described shared drive address information of preserving;
Described system service reads described first data, go forward side by side row relax in the mode of poll from described first memory headroom by described second kernel, obtains the first data after processing, and the first data after described process are written to described first memory headroom;
Described first agent's module reads first data described process after in the mode of poll from described first memory headroom by described first kernel, and by described first kernel, the first data after described process is sent to described consumer process.
In the implementation that the first is possible, in conjunction with first aspect, the first data after described first agent's module reads described process in the mode of poll from described first memory headroom by described first kernel, and after by described first kernel the first data after described process being sent to described consumer process, also comprise:
Described shared drive address information is sent to described consumer process by described first kernel by described first agent's module;
Described consumer process sets up the connection with described system service according to described shared drive address information, and
Preserve link information used when connecting between described consumer process and described system service, described in
Link information comprises the service identifiers of described system service, described shared drive address information.
In the implementation that the second is possible, the implementation possible according to the first, before described consumer process sends the first request by the first kernel to described first agent's module, also comprises:
Judge whether connect between described consumer process and described system service;
If not, then perform described consumer process by the first kernel to the subsequent step after described first agent's module sends the first request and this step, realize the communication between described consumer process and described system service, and set up connection between the two;
If so, then described consumer process is according to described link information, and write needs the first data of described system service process to first memory headroom corresponding with the shared drive address information of preserving in described link information;
Described system service reads described first data, row relax of going forward side by side from described first memory headroom, obtains the first data after processing, and the first data after described process are written to described first memory headroom;
Described consumer process reads the first data after described process from described first memory headroom.
In the implementation that the third is possible, the implementation possible according to the first, described first agent's module is preserved the shared drive address information that described system service and described consumer process share and comprise:
Described system service by described second kernel to operating system application shared drive;
Described system service notifies to described second agent's module the shared drive address information that described system service request is arrived by described second kernel;
Described second agent's module broadcasts described shared drive address information to described first agent's module;
Described first agent's module preserves described shared drive address information.
In the 4th kind of possible implementation, the implementation possible according to the first, described consumer process is set up according to described shared drive address information and is comprised with the connection of described system service:
The first corresponding for described shared drive address information memory headroom is mapped to the virtual address space of described system service by described system service;
The first corresponding for described shared drive address information memory headroom is mapped to the virtual address space of described first agent's module by described first agent's module;
The first corresponding for described shared drive address information memory headroom is mapped to the virtual address space of described consumer process by described consumer process.
In the 5th kind of possible implementation, in conjunction with first aspect, described first agent's module, described consumer process, described second agent's module and described system service are User space program.
Second aspect, communicator between a kind of consumer process and system service is provided, described device comprises multi-core platform, described multi-core platform comprises at least one first physics core and at least one the second physics core, described first physics core runs and has the first kernel, described first kernel runs and has first agent's module and one or more consumer process, described second physics core runs and has the second kernel, described second kernel runs and has second agent's module and system service, described first agent's module is preserved the shared drive address information that described system service and described consumer process are shared, described device also comprises storer, described consumer process, described first agent's module, described second agent's module and described system service are all stored in described storer:
Described first kernel, for reading the described first agent's module stored in storer, and sends the first request to described first agent's module, carries the first data that described consumer process needs described system service process in described first request;
Described first kernel also for, described first data of carrying in described first request are written to first memory headroom corresponding with the described shared drive address information of preserving;
Described second kernel, for reading described first data, row relax of going forward side by side in the mode of poll from described first memory headroom, obtaining the first data after processing, and the first data after described process is written to described first memory headroom;
Described first kernel also for, read the first data after described process in the mode of poll from described first memory headroom, and by described first kernel, the first data after described process sent to described consumer process.
In the implementation that the first is possible, in conjunction with first aspect, described first kernel also for, described shared drive address information is sent to described consumer process, performed by described consumer process and set up the connection with described system service according to described shared drive address information, and preserve link information used when connecting between described consumer process and described system service, described link information comprises the service identifiers of described system service, the method for described shared drive address information.
In the implementation that the second is possible, the implementation possible according to the first, described first kernel also for, judge whether connect between described consumer process and described system service, if not, then first set up the connection between described system service, and preserve the link information used when connecting between the two, if, then read the described consumer process stored in storer, performed according to described link information by described consumer process, write needs the method for the first data to first memory headroom corresponding with the shared drive address information of preserving in described link information of described system service process,
Described second kernel is also for reading the described system service stored in storer, performed by described system service and read described first data from described first memory headroom, to go forward side by side row relax, obtain the first data after processing, and the first data after described process are written to the method for described first memory headroom;
Described first kernel also for, read in storer the described consumer process stored, performed the method reading the first data after described process from described first memory headroom by described consumer process.
In the implementation that the third is possible, the implementation possible according to the first, described second kernel also for, first to operating system application shared drive, then to described second agent's module notify described system service request to shared drive address information performed the method broadcasting described shared drive address information to described first agent's module by described second agent's module;
Described first kernel, also for reading the described first agent's module stored in storer, is performed the method for preserving described shared drive address information by described first agent's module.
In the 4th kind of possible implementation, the implementation possible according to the first, described second kernel also for, read the system service stored in storer, performed the method the first corresponding for described shared drive address information memory headroom being mapped to the virtual address space of described system service by described system service;
Described first kernel also for, read in storer the described first agent's module stored, performed the virtual address space the first corresponding for described shared drive address information memory headroom being mapped to described first agent's module by described first agent's module;
Described first kernel also for, read in storer the described consumer process stored, performed the method the first corresponding for described shared drive address information memory headroom being mapped to the virtual address space of described consumer process by described consumer process.
In the 5th kind of possible implementation, in conjunction with second aspect, described first agent's module, described consumer process, described second agent's module and described system service are User space program.
In the embodiment of the present invention, consumer process sends the first request by the first kernel to first agent's module, carries the first data that described consumer process needs system service process in the first request; After first agent's module receives the first request, first data of carrying in being asked first by the first kernel are written to first memory headroom corresponding with the shared drive address information of preserving; System service reads first data in the mode of poll from the first memory headroom by the second kernel, row relax of going forward side by side, and obtains the first data after processing, and the first data after process are written to the first memory headroom; First agent's module passes through the first kernel in the mode of poll from the first data after the first memory headroom reading process, and by the first kernel, the first data after process is sent to consumer process.The system overhead of needs 8 contextual processing+2 intercore communication of prior art consumer process and system service once being communicated is reduced to 4 contextual processing+2 intercore communication, greatly reduces the expense of contextual processing.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
In embodiments of the present invention, consumer process sends the first request by the first kernel to first agent's module, carries the first data that described consumer process needs system service process in the first request; After first agent's module receives the first request, first data of carrying in being asked first by the first kernel are written to first memory headroom corresponding with the shared drive address information of preserving; System service reads first data in the mode of poll from the first memory headroom by the second kernel, row relax of going forward side by side, and obtains the first data after processing, and the first data after process are written to the first memory headroom; First agent's module passes through the first kernel in the mode of poll from the first data after the first memory headroom reading process, and by the first kernel, the first data after process is sent to consumer process.
Below in conjunction with specific embodiment, realization of the present invention is described in detail:
Fig. 3 shows the realization flow of the communication means between consumer process and system service that one embodiment of the invention provides, the method can be applied to multi-core platform, wherein, this multi-core platform comprises at least one first physics core and at least one the second physics core, first physics core runs and has the first kernel, first kernel runs and has first agent's module and one or more consumer process, second physics core runs and has the second kernel, second kernel runs and has second agent's module and system service, and first agent's module is preserved the shared drive address information that system service and consumer process share, wherein, first agent's module, consumer process, second agent's module and system service are User space program.For convenience of explanation, illustrate only part related to the present embodiment, details are as follows:
Step S301, consumer process send the first request by the first kernel to first agent's module, carry the first data that consumer process needs system service process in the first request.
In embodiments of the present invention, before os starting, need the kernel of the preset number in operating system to mark off to be used as system service kernel, these system service kernels run specific system service.Under normal circumstances, on these system service kernels, system service can discharge after obtaining CPU, can reduce unnecessary contextual processing; Unless it is desired to, CPU control can be given system service kernel by system service, system service kernel can run core functions or dispatch, run the process of some other necessity, such as, in the present embodiment, using the second kernel that the second physics core runs as a system service kernel, the second kernel runs and has the system service of specifying.
Also need to set up a monitor on these system service kernels, such as, second kernel runs and has second agent's module, because system service is all carried out registration in an operating system, monitor, except setting up communication internuclear in each, can connect with each system service.In the present embodiment, monitor and system service is allowed directly to set up communicating of User space.Such monitor just by the direct calling system service of User space communication, can decrease the process being switched to goal systems service.In addition, when migration occurs in system service, when namely system service is from a kernel migration to another kernel, system service needs to register oneself to the monitor corresponding with the kernel migrated to.
Also need the memory management module of retouching operation system, the linear address of internal memory is divided into three parts, kernel spacing Kernel Space, user's space User Space and shared address space.There are fixing skew offset and size in shared address space, and just there has been fixing physical location in such shared address space.Then, shared address spatial division is become the shared physical memory Shared Space of predetermined number, as shown in Figure 6, each shared physical memory is for different system services, for convenience of description, by the system service request in the present embodiment to shared physical memory space be called the first memory headroom.
Each shared physical memory is divided into head and message body two parts, as shown in Figure 7, wherein, head is used for arranging zone bit, used is crossed containing useful, mark ID, label tags and two bitmap images bitmap, consumer process request free memory space is used for crossing bitmap used bitmap, preparation bitmap ready bitmap is used for service processes and reads message blocks, message body is divided into the message blocks of fixed size one by one, as message blocks Msg block1, message blocks Msg block2 etc., zone bit one_to_one corresponding in the bitmap of these message blocks and head, such as, first zone bit correspondence in Msg block1 and bitmap, second zone bit correspondence in Msg block2 and bitmap.
After os starting, first the monitor on each kernel starts, and first sets up full connection between all monitor; Secondly, system service starts, and the system service after startup can send initiation message to local monitor, and local monitor sends initiation message to other monitor all, and then all monitor just can connect with the system service of this startup.In addition, a shared physical memory can be obtained to operating system application after system service process initiation, and some zone bits revised in this shared physical memory, certain system service that belongs to declared in this shared physical memory uses, and the virtual address space of this shared physical memory mappings to oneself; Its meeting broadcast simultaneously, tell the shared physical memory that the monitor on each kernel takies oneself, monitor is also the virtual address space of this shared physical memory mappings to oneself, and both sides just can operate this block simultaneously and share physical memory and carry out having communicated.
After step S302, first agent's module receive the first request, first data of carrying in being asked first by the first kernel are written to first memory headroom corresponding with the shared drive address information of preserving.
In embodiments of the present invention, whether the first kernel inquires about totally first memory headroom corresponding with this shared drive address information idle, if idle, then in this first memory headroom, write the first data, after write, corresponding zone bit in set ready bitmap, shows in which message blocks that the first data write in the first memory headroom.
Step S303, system service read first data in the mode of poll from the first memory headroom by the second kernel, row relax of going forward side by side, and obtain the first data after processing, and the first data after process are written to described first memory headroom.
In embodiments of the present invention, the second kernel poll ready bitmap, once find that the corresponding zone bit in ready bitmap is set, then reads the first data, and provides corresponding service from this first memory headroom.After system service provides service to terminate, the zone bit in the ready bitmap that erasing is corresponding and used bitmap.
Step S304, first agent's module pass through the first kernel in the mode of poll from the first data after the first memory headroom reading process, and by the first kernel, the first data after process are sent to consumer process.
Wherein, it should be noted that, shared drive address information comprise to carry out with consumer process the system service communicated the address of the first memory headroom of applying for.
Can make first agent's module is preserved by following steps the shared drive address information that system service and consumer process share:
Step 1, system service pass through the second kernel to operating system application shared drive.
Wherein, also can pass through other method application shared drive, as long as can apply for that one piece of shared drive is just passable, not do concrete restriction at this.
The shared drive address information that step 2, system service are arrived to the system service request of second agent's module notice by the second kernel.
Step 3, second agent's module broadcast this shared drive address information to first agent's module.
Wherein, second agent's module can broadcast this shared drive address information by the mode of broadcast to all proxy modules, and first agent's module can broadcast listening, gets the address of the first memory headroom that system service uses.Certainly, second agent's module also can pass through operating system, by the communication mode between the process such as pipeline, mailbox, this shared drive address information is transferred to first agent's module by operating system, and concrete which kind of mode of employing, this is not restricted.
Step 4, first agent's module preserve this shared drive address information.
The present embodiment, between consumer process and system service, can be completed by 4 contextual processing+2 intercore communication and once communicate, greatly reduce the expense of contextual processing.
Fig. 4 shows the realization flow of the communication means between consumer process and system service that further embodiment of this invention provides, the method can be applied to multi-core platform, wherein, this multi-core platform comprises at least one first physics core and at least one the second physics core, first physics core runs and has the first kernel, first kernel runs and has first agent's module and one or more consumer process, second physics core runs and has the second kernel, second kernel runs and has second agent's module and system service, and first agent's module is preserved the shared drive address information that system service and consumer process share, wherein, first agent's module, consumer process, second agent's module and system service are User space program.For convenience of explanation, illustrate only part related to the present embodiment, details are as follows:
Step S401, consumer process send the first request by the first kernel to first agent's module, carry the first data that consumer process needs system service process in the first request.
After step S402, first agent's module receive the first request, first data of carrying in being asked first by the first kernel are written to first memory headroom corresponding with the shared drive address information of preserving.
Step S403, system service read first data in the mode of poll from the first memory headroom by the second kernel, row relax of going forward side by side, and obtain the first data after processing, and the first data after process are written to described first memory headroom.
Step S404, first agent's module pass through the first kernel in the mode of poll from the first data after the first memory headroom reading process, and by the first kernel, the first data after process are sent to consumer process.
Shared drive address information is sent to consumer process by the first kernel by step S405, first agent's module.
Step S406, consumer process set up the connection with system service according to shared drive address information, and preserve link information used when connecting between consumer process and system service, this link information comprises service identifiers, the shared drive address information of system service.
Wherein, consumer process is set up according to shared drive address information and is specifically comprised with the process of the connection of system service:
The first corresponding for shared drive address information memory headroom is mapped to the virtual address space of system service by step 11, system service.
The first corresponding for shared drive address information memory headroom is mapped to the virtual address space of first agent's module by step 12, first agent's module.
The first corresponding for shared drive address information memory headroom is mapped to the virtual address space of consumer process by step 13, consumer process.
The present embodiment, after completing once communication between consumer process and system service, shared drive address information is sent to consumer process by the first kernel by first agent's module, consumer process sets up the connection with system service according to shared drive address information, and preserve link information used when connecting between consumer process and system service, follow-up, consumer process and system service the first memory headroom namely by operating this shared drive address information corresponding realizes communicating.
Fig. 5 shows the realization flow of the communication means between consumer process and system service that further embodiment of this invention provides, the method can be applied to multi-core platform, wherein, this multi-core platform comprises at least one first physics core and at least one the second physics core, first physics core runs and has the first kernel, first kernel runs and has first agent's module and one or more consumer process, second physics core runs and has the second kernel, second kernel runs and has second agent's module and system service, and first agent's module is preserved the shared drive address information that system service and consumer process share, wherein, first agent's module, consumer process, second agent's module and system service are User space program.For convenience of explanation, illustrate only part related to the present embodiment, details are as follows:
Step S501, judge whether connect between consumer process and system service, if not, then perform step S502 to S507 successively, if so, then perform step S508 to S510 successively.
Step S502, consumer process send the first request by the first kernel to first agent's module, carry the first data that consumer process needs system service process in the first request.
After step S503, first agent's module receive the first request, first data of carrying in being asked first by the first kernel are written to first memory headroom corresponding with the shared drive address information of preserving.
Step S504, system service read first data in the mode of poll from the first memory headroom by the second kernel, row relax of going forward side by side, and obtain the first data after processing, and the first data after process are written to described first memory headroom.
Step S505, first agent's module pass through the first kernel in the mode of poll from the first data after the first memory headroom reading process, and by the first kernel, the first data after process are sent to consumer process.
Shared drive address information is sent to consumer process by the first kernel by step S506, first agent's module.
Step S507, consumer process set up the connection with system service according to shared drive address information, and preserve link information used when connecting between consumer process and system service, this link information comprises service identifiers, the shared drive address information of system service.
Step S508, consumer process are according to link information, and write needs the first data of system service process to first memory headroom corresponding with the shared drive address information of preserving in link information.
Step S509, system service read the first data from the first memory headroom, row relax of going forward side by side, and obtain the first data after processing, and the first data after process are written to the first memory headroom.
Step S510, consumer process are from the first data after the first memory headroom reading process.
The present embodiment, before communicating between consumer process and system service, whether connect both first judging, if connected, then according to the shared drive address information of preserving in link information used when connecting between consumer process and system service, operate the first memory headroom corresponding to this shared drive address information and realize communication, one time communication process only needs 2 intercore communication, greatly reduces the expense of contextual processing.
Fig. 8 shows the concrete structure block diagram of the communicator between consumer process and system service that the embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.Described device 8 comprises multi-core platform, described multi-core platform comprises at least one first physics core and at least one the second physics core, described first physics core runs and has the first kernel, described first kernel runs and has first agent's module 81 and one or more consumer process 82, described second physics core runs and has the second kernel, described second kernel runs and has second agent's module 83 and system service 84, described first agent's module 81 is preserved the shared drive address information that described system service 84 is shared with described consumer process 82, wherein, described first agent's module 81, described consumer process 82, described second agent's module 83 and described system service 84 are User space program.Described consumer process 82 comprises:
First request transmitting unit 821, for sending the first request by the first kernel to described first agent's module, carries the first data that described consumer process needs described system service process in described first request;
Described first agent's module 81 comprises:
Described first data of carrying in described first request, after receiving the first request, are written to first memory headroom corresponding with the described shared drive address information of preserving by described first kernel by the one the first data write units 811;
Described system service 84 comprises:
The one the first data processing units 841, for reading described first data in the mode of poll from described first memory headroom by described second kernel, to go forward side by side row relax, obtain the first data after processing, and the first data after described process are written to described first memory headroom;
Described first agent's module 81 also comprises:
The first data after described process for reading first data described process after in the mode of poll from described first memory headroom by described first kernel, and are sent to described consumer process by described first kernel by the one the first data-reading unit 812.
Further, described first agent's module 81 also comprises:
Shared drive address information transmitting element, for sending to described consumer process by described first kernel by described shared drive address information;
Described consumer process 82 also comprises:
Connection establishment unit, for setting up the connection with described system service according to described shared drive address information, and preserve link information used when connecting between described consumer process and described system service, described link information comprises the service identifiers of described system service, described shared drive address information.
Further, described consumer process 82 also comprises:
Whether connection judgment unit, connect between described system service for judging, if not, then first sets up the connection between described system service, and preserve the link information used when connecting between the two;
The two the first data write units, for if then according to described link information, write needs the first data of described system service process to first memory headroom corresponding with the shared drive address information of preserving in described link information;
Described system service 84 also comprises:
The two the first data processing units, for reading described first data, row relax of going forward side by side from described first memory headroom, obtaining the first data after processing, and the first data after described process being written to described first memory headroom;
Described consumer process 82 also comprises:
The two the first data-reading unit, for reading the first data after described process from described first memory headroom.
Further, described system service 84 also comprises:
Shared drive application unit 842, for by described second kernel to operating system application shared drive;
Address information notification unit 843, for notifying to described second agent's module the shared drive address information that described system service request is arrived by described second kernel;
Described second agent's module 83 comprises:
Broadcasting address information unit 831, for broadcasting described shared drive address information to described first agent's module;
Described first agent's module 81 comprises:
Address information storage unit 813, for preserving described shared drive address information.
Further, described system service 83 also comprises:
First map unit, for mapping to the virtual address space of described system service by the first corresponding for described shared drive address information memory headroom;
Described first agent's module 81 also comprises:
Second mapping block, for mapping to the virtual address space of described first agent's module by the first corresponding for described shared drive address information memory headroom;
The connection establishment unit of described consumer process 82 comprises:
3rd mapping block, for mapping to the virtual address space of described consumer process by the first corresponding for described shared drive address information memory headroom.
The device that the embodiment of the present invention provides can be applied in the embodiment of the method for aforementioned correspondence, and details, see the description of said method embodiment, do not repeat them here.
Fig. 9 shows the concrete structure block diagram of the communicator between consumer process and system service that the embodiment of the present invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.Described device 9 comprises multi-core platform, described multi-core platform comprises at least one first physics core and at least one the second physics core, described first physics core runs and has the first kernel 91, described first kernel 91 runs and has first agent's module and one or more consumer process, described second physics core runs and has the second kernel 92, described second kernel 92 runs and has second agent's module and system service, described first agent's module is preserved the shared drive address information that consumer process described in described system service is shared, wherein, first agent's module, consumer process, second agent's module and system service are User space program, be stored in storer 93.
Wherein, the first kernel 91, for reading the first agent's module stored in storer 93, and sends the first request to described first agent's module, carries the first data that described consumer process needs described system service process in described first request;
Described first kernel 91 also for, described first data of carrying in described first request are written to first memory headroom corresponding with the described shared drive address information of preserving;
Second kernel 92, for reading described first data, row relax of going forward side by side in the mode of poll from described first memory headroom, obtaining the first data after processing, and the first data after described process is written to described first memory headroom;
First kernel 91 also for, read the first data after described process in the mode of poll from described first memory headroom, and by described first kernel, the first data after described process sent to described consumer process.
Further, first kernel 91 also for, described shared drive address information is sent to described consumer process, performed by described consumer process and set up the connection with described system service according to described shared drive address information, and preserve link information used when connecting between described consumer process and described system service, described link information comprises the service identifiers of described system service, the method for described shared drive address information.
Further, first kernel 91 also for, judge whether connect between described consumer process and described system service, if not, then first set up the connection between described system service, and preserve the link information used when connecting between the two, if, then read the described consumer process stored in storer, performed according to described link information by described consumer process, write needs the method for the first data to first memory headroom corresponding with the shared drive address information of preserving in described link information of described system service process;
Second kernel 92 also for, read the described system service stored in storer 93, performed by described system service and read described first data from described first memory headroom, to go forward side by side row relax, obtain the first data after processing, and the first data after described process are written to the method for described first memory headroom;
First kernel 91 also for, read the described consumer process stored in storer 93, performed the method reading the first data after described process from described first memory headroom by described consumer process.
Further, second kernel 92 also for, first to operating system application shared drive, then to described second agent's module notify described system service request to shared drive address information performed the method broadcasting described shared drive address information to described first agent's module by described second agent's module;
First kernel 91 also for, read the described first agent's module stored in storer 93, performed the method for preserving described shared drive address information by described first agent's module.
Further, the second kernel 92 also for, read the system service stored in storer 93, performed the method the first corresponding for described shared drive address information memory headroom being mapped to the virtual address space of described system service by described system service;
First kernel 91 also for, read the described first agent's module stored in storer 93, performed the virtual address space the first corresponding for described shared drive address information memory headroom being mapped to described first agent's module by described first agent's module;
First kernel 91 also for, read the described consumer process stored in storer 93, performed the method the first corresponding for described shared drive address information memory headroom being mapped to the virtual address space of described consumer process by described consumer process.
The device that the embodiment of the present invention provides can be applied in the embodiment of the method for aforementioned correspondence, and details, see the description of said method embodiment, do not repeat them here.
It should be noted that in said apparatus embodiment, included unit is carry out dividing according to function logic, but is not limited to above-mentioned division, as long as can realize corresponding function; In addition, the concrete title of each functional unit, also just for the ease of mutual differentiation, is not limited to protection scope of the present invention.
In addition, one of ordinary skill in the art will appreciate that all or part of step realized in the various embodiments described above method is that the hardware that can carry out instruction relevant by program has come, corresponding program can be stored in a computer read/write memory medium, described storage medium, as ROM/RAM, disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.