CN108062252A - A kind of information interacting method, method for managing object and device and system - Google Patents
A kind of information interacting method, method for managing object and device and system Download PDFInfo
- Publication number
- CN108062252A CN108062252A CN201610983813.6A CN201610983813A CN108062252A CN 108062252 A CN108062252 A CN 108062252A CN 201610983813 A CN201610983813 A CN 201610983813A CN 108062252 A CN108062252 A CN 108062252A
- Authority
- CN
- China
- Prior art keywords
- thread
- region
- memory
- shared drive
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/524—Deadlock detection or avoidance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
- Multi Processors (AREA)
Abstract
This application discloses a kind of information interacting method, method for managing object and device and system.In the application, first thread writes data to shared drive region, wherein, the shared drive region is different from the region of memory that the memory management object in dynamic language engine is managed, and use can be shared by multiple threads, the memory management object is used to manage region of memory used in thread;Location information of the first thread data to be written in the shared drive region is sent to the second thread.Different threads object can so be made to be based on the shared drive object implementatio8 information exchange, so as to reduce the complexity of cross-thread communication, and improve communication efficiency.
Description
Technical field
This application involves a kind of field of computer technology more particularly to information interacting method, method for managing object and devices
And system.
Background technology
Cloud operating system provides the base power of operating system based on Node.js to user's application.Node.js is built upon
The web application frame of JavaScript engine on Chrome.Node.js carries runtime environment, can be
It explains and performs on the basis of JavaScript code.Allow to perform on any machine beyond browser during the operation
JavaScript code.Node.js additionally provides various abundant JavaScript module librarys, simplifies and is come using Node.js
Extend the research and development of web application.In simple terms, Node.js provides running environment and JavaScript code
Storehouse.
JavaScript engine acquiescence Node.js is applied based on single-threaded model, although Node.js using asynchronous call and
Non- block type input/output (I/O) event model can improve response efficiency, but for compute-intensive applications, single thread mould
Type seriously affects application operation efficiency.
For this purpose, Node.js provides multi-process storehouse (sub-process modules), although being improved to a certain degree using flat
Row ability, but cross-thread communication is needed between multithreading, it is less efficient, it is impossible to meet the needs of user is to multithreading.
The content of the invention
The embodiment of the present application provides a kind of information interacting method, method for managing object and device and system, to be directed to base
In the application of Object-Oriented Programming Language, multithreading efficient communication is realized.
Information interacting method provided by the embodiments of the present application, including:
First thread writes data to shared drive region;Wherein, in the shared drive region and dynamic language engine
The region of memory that is managed of memory management object it is different, and uses can be shared by multiple threads, the memory management object use
In region of memory used in management thread;
Location information of the first thread data to be written in the shared drive region is sent to the second thread.
Optionally, location information of the first thread data to be written in the shared drive region is sent to
Two threads, including:First thread is by performing the message delivery method defined in first thread object, and data to be written is in institute
It states the location information in shared drive region and is sent to the second thread;Wherein, the first thread using following parameter as described in
The input parameter of message delivery method:The data of mark and the first thread write-in of second thread are in the shared drive region
In location information.
Optionally, before the first thread writes data to shared drive region, further include:
The first thread is obtained according to the size of data to be written to son correspondingly sized in the shared drive region
The write permission in region;
After the first thread writes data to shared drive region, further include:
The first thread releases the write permission to the subregion.
Wherein, the first thread is obtained according to the size of data to be written to corresponding big in the shared drive region
The write permission of small subregion, including:The first thread is by performing in memory management object plus writing locking method, to described
In shared drive region with data to be written shared by the correspondingly sized subregion of size add and write lock;Wherein, the first thread will
The size of data to be written adds the input parameter for writing locking method as described in;The subregion is write in the first thread releasing
Permission, including:The first thread is released and added writes lock by performing the unlocking method in the memory management object;Its
In, the first thread adds the lock object for writing locking method return as the input parameter of the unlocking method, the lock using described
Object, which is used to indicate, has added the region of memory for writing lock.
The information interacting method that the application other embodiment provides, including:
The data that the first thread that second thread receives first thread transmission writes in shared drive are described common
Enjoy the location information in region of memory;Wherein, the region of memory is managed with the memory management object in dynamic language engine
Region of memory it is different, and uses can be shared by multiple threads, the memory management object is interior used in thread for managing
Deposit region;
Second thread reads the first thread write-in according to the location information from the shared drive region
Data.
Optionally, the location information, including:The data of the first thread write-in are in the shared drive region
Region of memory size shared by the data of initial position and write-in.
Optionally, the second thread receives the data that the first thread that first thread is sent writes in shared drive and exists
Location information in the shared drive region, including:
Second thread receives the message that the first thread is sent, and carrying the first thread in the message writes
Location information of the data entered in the shared drive region.
Optionally, second thread reads described first according to the location information from the shared drive region
Before the data of thread write-in, further include:
Second thread obtains the reading to respective sub-areas in the shared drive region and weighs according to the location information
Limit;
After second thread reads the data of the first thread write-in from the shared drive region, also wrap
It includes:
Second thread releases the read right of the subregion.
Optionally, second thread is obtained according to the location information to correspondingly sized in the shared drive region
Subregion read right, including:
Second thread is by performing the read lock method in memory management object, to phase in the shared drive region
Answer the subregion read lock of size;Wherein, second thread is using the location information as the input of the read lock method
Parameter;
Second thread releases the read right to the subregion, including:
Second thread releases added read lock by performing the unlocking method in the memory management object;Wherein,
The lock object that second thread returns to the read lock method is as the input parameter of the unlocking method, the lock object
It is used to indicate the region of memory for having added write-read.
Method for managing object provided by the embodiments of the present application, including:
Create shared drive object, the corresponding region of memory of the shared drive object and the memory in dynamic language engine
The region of memory that management object is managed is different, and the memory management object is used to manage region of memory used in thread;
Thread object is created, the thread object is associated with the shared drive object, so that the thread object corresponds to
Thread share using the corresponding region of memory of the shared drive object.
Optionally, the thread object includes memory attribute, and the shared drive object includes shared drive object
Identity property;In the following manner, the thread object is associated with the shared drive object:It will be in the thread object
The value of memory attribute is arranged to identical with the value of the shared drive object identity attribute in the shared drive object.
Optionally, included in the shared drive object with properties:Shared drive object identity, is total to for unique mark
Enjoy memory object;
Following methods are included in the shared drive object:Data writing method, for corresponding interior to shared drive object
Deposit region write-in data;Data reading method, for reading data from the corresponding region of memory of shared drive object.
Further, following methods are further included in the shared drive object:
Add and write locking method, for the specified son in the corresponding region of memory of the shared drive object or the region of memory
Region, which adds, writes lock, and the thread of write permission is not obtained to being added the region of memory for writing lock write-in data or write lock from being added with obstruction
Region of memory reads data;
Unlocking method added writes lock for releasing.
Wherein, input parameter that is described plus writing locking method includes:The specified subregion is in the shared drive object pair
The size of initial position and the specified subregion in the region of memory answered.
Optionally, following methods are further included in the shared drive object:
Read lock method, for the specified son in the corresponding region of memory of the shared drive object or the region of memory
Region read lock writes number to block other threads in addition to the read lock method is called to by the region of memory of read lock
According to;
Unlocking method, for releasing added read lock.
Wherein, the input parameter of the read lock method includes:The specified subregion is in the shared drive object pair
The size of initial position and the specified subregion in the region of memory answered.
Optionally, the thread object is included with properties:
Thread object identifies, for unique mark thread object;
The thread object includes following methods:
Message delivery method, for transferring message between thread object.
Optionally, further include:Loading code storehouse, the code library include:For creating the code of shared drive object
And corresponding first interface and for creating the code of thread object and corresponding second interface;
Shared drive object is created, including:The first interface is called, establishment obtains shared drive object;
Thread object is created, including:The second interface is called, establishment obtains thread object.
Optionally, when calling the first interface using original allocation region of memory size and reserved region of memory size as
Input parameter, so as to create the size of the region of memory corresponding to obtained shared drive object and the original allocation memory field
Domain size is identical, and identical with the reserved region of memory size for the region of memory size that the shared drive object is reserved;
Alternatively, using original allocation region of memory size as input parameter when calling the first interface so that create obtain it is shared
The size of region of memory corresponding to memory object is identical with the original allocation region of memory size;Alternatively, call described the
Using reserved region of memory size as input parameter during one interface, so as to create the memory corresponding to obtained shared drive object
The size in region is identical with the region of memory size of default setting, and the region of memory size reserved for the shared drive object
It is identical with the reserved region of memory size.
Optionally, the quantity of the shared drive object created is one or more;If the shared drive object created
Quantity to be multiple, then the thread object created is grouped, thread object and a shared drive object in each grouping
Association, the shared drive object associated by the thread object of different grouping are different from each other.
Information interactive device provided by the embodiments of the present application, the device be the corresponding device of first thread object, the device
Including:
Write operation module, for writing data to shared drive region;Wherein, the shared drive region and dynamic language
The region of memory that memory management object in engine is managed is different, and use, the memory management can be shared by multiple threads
Object is used to manage region of memory used in thread;
Interactive module is sent to the second line for location information of the data to be written in the shared drive region
Journey.
The information interactive device that the application other embodiment provides, the device are the corresponding device of the second thread object,
The device includes:
Interactive module, the data that the first thread for receiving first thread transmission writes in shared drive are in institute
State the location information in shared drive region;Wherein, the region of memory and the memory management object institute in dynamic language engine
The region of memory of management is different, and use can be shared by multiple threads, and the memory management object is used for managing thread
Region of memory;
Read operation module, for according to the location information, the first thread to be read from the shared drive region
The data of write-in.
Object Management group device provided by the embodiments of the present application, including:
Shared drive object management module, for creating shared drive object, the corresponding memory of the shared drive object
Region is different from the region of memory that the memory management object in dynamic language engine is managed, and the memory management object is used to manage
Region of memory used in lineation journey;
Thread object management module, for creating thread object, the thread object is associated with the shared drive object,
So that the corresponding thread of the thread object is shared using the corresponding region of memory of the shared drive object.
Cloud operating system provided by the embodiments of the present application, including:Ccf layer and system kernel when application layer, operation;
Include during the operation in ccf layer comprising dynamic language engine and code library, the code library:For creating
Build the code of shared drive object and the code for creating thread object;
By described for creating the shared drive object that the code of shared drive object created, corresponding to memory
Region is different from the region of memory that the memory management object in dynamic language engine is managed, and the memory management object is used to manage
Region of memory used in lineation journey;
Thread object is created for creating the code of thread object by described, is associated with the shared drive object,
So that the corresponding thread of the thread object is shared using the corresponding region of memory of the shared drive object.
Computer equipment provided by the embodiments of the present application, including:Processor, memory;
Memory, for storing computer program instructions;
Processor is coupled to the memory, for reading the computer program instructions of the memory storage, and conduct
Response performs following operation:
First thread writes data to shared drive region;Wherein, in the shared drive region and dynamic language engine
The region of memory that is managed of memory management object it is different, and uses can be shared by multiple threads, the memory management object use
In region of memory used in management thread;
Location information of the first thread data to be written in the shared drive region is sent to the second thread.
In above-described embodiment of the application, due in the corresponding region of memory of shared drive object and dynamic language engine
The region of memory that memory management object is managed is different, and can share use by multiple threads, i.e. multiple threads can be common based on this
It enjoys the corresponding region of memory of memory object and realizes information exchange, compared to based on the memory management object wound in dynamic language engine
The problem of building high communication complexity between the thread caused by multithreading, inefficiency, using above-described embodiment of the application,
The memory that multithreading object-sharing uses is created outside the region of memory that memory management object in dynamic language engine is managed
Region, so that different threads are based on the shared drive object implementatio8 information exchange, so as to reduce the complexity of cross-thread communication,
And improve communication efficiency.
Description of the drawings
Fig. 1 is Multi-Thread.addon provided by the embodiments of the present application, between thread object, shared drive object
Relation schematic diagram;
Fig. 2 is the visioning procedure schematic diagram of shared drive object provided by the embodiments of the present application and thread object;
Fig. 3 is one of thread information interaction flow diagram provided by the embodiments of the present application;
Fig. 4 is the two of thread information interaction flow diagram provided by the embodiments of the present application;
Fig. 5 is the flow diagram that downloadThread objects provided by the embodiments of the present application write data;
Fig. 6 is the flow diagram that playerThread objects provided by the embodiments of the present application read data;
Fig. 7 is the structure diagram of Object Management group device provided by the embodiments of the present application;
Fig. 8 is the structure diagram of information interactive device provided by the embodiments of the present application;
Fig. 9 is the structure diagram for the information interactive device that the application other embodiment provides;
Figure 10 is the structure diagram of computer equipment provided by the embodiments of the present application;
Figure 11 is operating system configuration diagram provided by the embodiments of the present application.
Specific embodiment
Cloud operating system based on Node.js to user application provide operating system base power, it is desirable that Node.js into
The extension and enhancing of row appropriateness, for example, for the more demanding application of parallel computation, Node.js is required to provide multithreading
The memory sharing technology of traffic model and cross-thread.
For this purpose, the embodiment of the present application proposes the memory sharing technology between multi-threading correspondence model and multithreading, base
In the application of multi-threading correspondence and memory sharing technology, operational efficiency can be improved, improves user reponding time, is applicable to count
Calculate intensive applications.
The embodiment of the present application is applicable to the application program that the programming language based on object-oriented is write, for example,
The programming language of the object-oriented may include JavaScript, may also include other kinds of programming language certainly, herein not
It enumerates again.
The application is implemented in application framework but outside dynamic language engine (such as JavaScript engine), is carried
Multi-threading correspondence and memory sharing technology are supplied.By taking JavaScript as an example, the application implement in Node.js frames but
Outside JavaScript engine, multi-threading correspondence and memory sharing technology are provided.In simple terms, the embodiment of the present application exists
The primary thread of system is created in Node.js, and is created outside the isolate objects of JavaScript engine for multiple lines
The region of memory that journey is shared departs from the memory management mechanism of JavaScript engine, provides more flexible and efficient memory pipe
Reason ability.Wherein, dynamic language is a language category in computer programming language, is that one kind operationally can be dynamically
Change type, the language of structure, operationally function and attribute can be increased, change and delete.Such as JavaScript,
Python, Ruby etc. belong to dynamic language.Dynamic language, which need not compile, to be run, and operationally need running environment
Support, this environment are called runtime environment, it is virtual comprising the required all elements of dynamic language operation, such as Java
Machine, JavaScript engine etc..Isolate objects are the objects for being used to carry out memory management in JavaScript engine, for example,
Isolate can represent a separate instance of JavaScript engine, can manage the internal storage state of thread, be responsible for the thread
The establishment of each JavaScript object and the work such as recycling in operational process.
Application program involved in the embodiment of the present application can be various types of application programs, for example can be service
Component.By taking YunOS (a kind of cloud operating system) as an example, above application program can be the Page in YunOS.Page is to local
Service and abstract namely service the elementary cell of remote service, by the encapsulation to data and method, can provide various clothes
Business.One service scenarios can include multiple Page.For example, a Page can be user interface (User
Interface, abbreviation UI), services or the background service, such as account authentication such as take pictures.Run mode Page is known as Page realities
Example is the operation carrier of local service or remote service.Each Page can be uniquely identified in YunOS.
The embodiment of the present application can be applicable to client and be also applicable in server end.Exemplified by applying in client, specifically
The equipment such as mobile terminal or PC (PC) are can be applicable to, the mobile terminal can be mobile phone, PDA (Personal
Digital Assistant, palm PC), car-mounted terminal or intelligent wearable device etc..
In order to be more clearly understood that the embodiment of the present application, first pair with the relevant Object-Oriented Programming skill of the embodiment of the present application
Some technical terms involved by art are briefly described.
- object:Can define in object has attribute and method, can encapsulate attribute (property) and method (method)
In object.In memory, these objects are some memory blocks in fact, and the inside saves data and the method that can be run.
- thread object:It is the instance objects of thread class.Thread object encapsulates some information of thread (such as including line
The method of Cheng Zhihang), the method in a thread object can be run by other threads.By taking JavaScript as an example, thread pair
As by inheriting thread classes or a new class can be derived by realizing that runnable interfaces obtain, such as from Thread,
Attribute and method are added in wherein, and can cover run () method, you can create the new thread object for completing a derived class.Its
In, the thread code to be performed is contained in run () method.
- thread:Thread is the execution route of the method defined in object, that is to say, that thread is the once execution of code
Process, in this implementation procedure, thread can also perform other in method defined in Executive Agent its thread object
Object in method.By taking JavaScript as an example, when by performing start after inheriting thread groups to create a thread object
() method, so as to start a thread.
In the embodiment of the present application, two kinds of objects are defined:
(1) shared drive object, a shared drive object can correspond to a region of memory.
It may include in shared drive object with properties:
- shared drive object identity, for unique mark shared drive object.
Following methods are may also include in shared drive object:
- data writing method, for writing data to the corresponding region of memory of shared drive object;
- data reading method, for reading data from the corresponding region of memory of shared drive object.
Further, following methods be may also include in shared drive object:
- plus locking method is write, for the specified sub-district in the corresponding region of memory of shared drive object or the region of memory
Domain, which adds, writes lock, does not apply thread to write permission to being added the region of memory for writing lock write-in data or write lock from being added with obstruction
Region of memory reads data.Wherein, optionally, input parameter that is above-mentioned plus writing locking method may include:Subregion is specified shared
The size of initial position and the specified subregion in the corresponding region of memory of memory object.
- read lock method, for the specified sub-district in the corresponding region of memory of shared drive object or the region of memory
Domain read lock writes data to block any thread to by the region of memory of read lock.Wherein, optionally, above-mentioned read lock side
The input parameter of method may include:Specify initial position of the subregion in the corresponding region of memory of shared drive object and should
Specify the size of subregion.
- unlocking method added writes lock or read lock for releasing.
(2) thread object
It can be included in thread object with properties:
- thread object identifies, for the unique mark thread object.
Following methods can be also included in thread object:
- message delivery method, for transferring message between thread object.It optionally, can in above-mentioned message delivery method
Including following input parameter:The mark of subject thread and the message content for passing to subject thread.
Further, other attributes and method can be also included in shared drive object and thread object, only listed here
Some attributes relevant with the embodiment of the present application and method.
Above-mentioned shared drive object and thread object can create to obtain by way of calling corresponding interface, such as can
The interface for calling to create shared drive object creates shared drive object, can call to create the interface wound of thread object
Build thread object.After shared drive object and thread object is created, thread object can be started, so as to start the execution of thread
Journey.
Multiple thread objects can be associated with same shared drive object, can so realize shared drive by multiple lines
Journey is shared.Specifically, memory object identity property can be included in thread object, and the value of the attribute is arranged to shared
The value of shared drive object identity in memory object, so as to which the thread object be associated with the shared drive object, so
On the one hand the corresponding region of memory of shared drive object can be accessed based on the thread that the thread object is started, on the other hand
It can also carry out the method included in the shared drive object.
Below by taking JavaScript as an example, the embodiment of the present application is described in detail with reference to attached drawing.
The embodiment of the present application provides the JavaScript code storehouse newly defined in Node.js, is included in the code library
It is used to implement the JavaScript code of Object Management group and multi-threading correspondence function provided by the embodiments of the present application.This is new
JavaScript code storehouse can be encapsulated as code module (being known as add-on modules).Code module (add-on modules) is
One of component of Node.js provides various functions (or method), externally provides the application programming of these functions
Interface (Application Programming Interface, abbreviation API), so as to by the way that these API is called to perform phase
The function answered realizes corresponding function.These functions can be realized by JavaScript code or C++ codes.
Below for convenience of description, Object Management group and multi-threading correspondence function provided by the embodiments of the present application will be used to implement
JavaScript code storehouse be encapsulated as multi-threaded code module (Multi-Thread.addon), can with compliant applications in
In Node.js frameworks.Optionally, multi-threaded code module can be loaded when Node.js is initialized, and can also be run in application program
Stage on-demand loading as needed.
Multi-threaded code module (Multi-Thread.addon) provide interface in a manner of API, to realize for thread pair
As the management function with shared drive object and the inter-thread communication function based on shared drive object.
For example, multi-threaded code module (Multi-Thread.addon) can be provided with lower interface:
- for creating the interface of thread object, for ease of description, the interface is known as thread object below and creates API;
- for creating the interface of shared drive object, for ease of description, the interface is known as shared drive object wound below
Build API.
By the way that thread object is called to create API, multi-threaded code module (Multi-Thread.addon) can be based on and provided
Realize thread object create function code establishing thread object.
Further, when calling thread object establishment API, it is possible to provide following input parameter:Pass to the first of thread object
Beginning parameter.Correspondingly, when creating thread object, the thread object being created can be configured according to the initial parameter.
Following function sentences schematically illustrate to create the function definition of thread object:
function createThread(job,args)
Wherein, createThread is function name, and performing the function can create to obtain thread object.Job and args points
It Wei not input parameter.Job is a JavaScript function, this function is the operation main body of the thread newly created, and args is
Main-thread object is transmitted to the initial parameter of sub-line journey object, wherein, main-thread object is to perform the thread object of calling process, son
Thread object is the thread object that the main-thread object creates.Args can be initial value or the message body of variable, can
To be defined with JSON forms.
The attribute and method that thread object is included mainly include:
-Token:The attribute of thread object, property value be integer value, the unique mark thread object, different threads object
Between communication can find given thread object using the token.
-sendMessage(token,message):Method in thread object, this method be used to implement a thread to
Another thread sends message.Message body can be the content of text that JSON forms define.This method is asynchronous call mode, should
The caller thread of method can return immediately after sending message, will not block caller thread.
By calling shared drive Object Creation API, can be shared based on the Multi-Thread.addon realizations provided interior
The code establishing shared drive object of Object Creation function is deposited, and can will be reserved for the shared drive object all or part of interior
Region is deposited, distributes to the shared drive object.In region of memory and JavaScript engine corresponding to shared drive object
The region of memory that isolate objects are managed is different, and can share use by multiple threads.
When calling shared drive Object Creation API, it is possible to provide following input parameter:Original allocation region of memory size and/
Or, reserved region of memory size.Correspondingly, when creating shared drive object, can be set according to original allocation region of memory size
The initial size of the corresponding region of memory of shared drive object, can also be according to reserved region of memory size, for the shared drive
Object reserves correspondingly sized region of memory.
By set shared drive region initial size and reserved shared drive region, it can be achieved that real to region of memory
Now distribute according to need.Can be the smaller memory of shared drive object distribution ratio when it is implemented, when creating shared drive object
Region (according to " original allocation region of memory size " parametric distribution), later if necessary to more in application program operational process
Memory source can then apply for the more region of memory of distribution on the basis of the region of memory of shared drive object is initially allocated to,
Until the region of memory size of distribution reaches the limitation of above-mentioned " reserved region of memory size ".In this way, memory source can be improved
Service efficiency.
The attribute and method that shared drive object includes mainly include:
-token:The attribute of shared drive object, property value be integer value, the unique mark shared drive object.Thread
Object can use shared drive object token inquire corresponding shared drive object attribute (such as read-write state or
Locking situation etc.).
-lockRD(start,size):Read lock method in shared drive object.This method can be realized to shared drive
Specified subregion read lock in the corresponding region of memory of object or the region of memory.Start and size is respectively input parameter,
Wherein, the initial position for the subregion that start expressions are locked, size represent to lock the size in region.LockRD () method can
To shared drive region plus read lock, it is read-only to show the region of memory, and any write operation of attempting the region of memory all will
Failure.LockRD () method can return to a lock object, which is part.
-lockRW(start,size):Adding in shared drive object, writes locking method.This method can be realized to shared drive
Specified subregion in the corresponding region of memory of object or the region of memory, which adds, writes lock.Start and size is respectively input parameter.
Wherein, the initial position for the subregion that start expressions are locked, size represent to lock the size in region.LockRW () method can
To shared drive region plus lock is write, it is read-write to show the region of memory, and whenever such region of memory only allows
To its read-write operation, the thread that other trials read or write will be blocked one thread.LockRW () method can return to one
Lock objects, the lock objects are part.
-unlock(lock):Unlocking method in shared drive object.This method, which can be realized, carries out shared drive region
Unlock.To shared drive region complete data read-write operation after, can call unlock () method to corresponding region of memory into
Row unlock is limited with the access released to other threads.Wherein, lock is the input parameter of unlock () method, is lockRD
The lock objects that () method or lockRW () method return.
-read(lock,data):Data reading method in shared drive object.This method can realize reading shared drive
The data stored in region.Lock is input parameter, and lock is the lock objects that lockRD () method returns.Data is output
Variable, the data read can be assigned to variable return.
-write(lock,data):Data writing method in shared drive object.This method can be realized to shared section key
Domain writes data.Lock and data is respectively input parameter.Wherein, lock is the lock objects that lockWR () method returns,
Data is the data for needing to write shared drive region.
Fig. 1 schematically illustrates multi-threaded code module (Multi-Thread.addon), thread object, shared drive
Relation between object:Call creatThread () method in multi-threaded code module (Multi-Thread.addon) can
Establishment obtains thread object (Thread), and token attributes and sendMessage () method can be included in thread object.It calls
CreateSharedBuffer () method in multi-threaded code module (Multi-Thread.addon), which can create, to be shared
Memory object (SharedBuffer) can include token attributes and lockRD () method, lockRW in shared drive object
() method, unlock () method, read () method, write () method.Certainly, above-mentioned thread object and shared drive object
In attribute and method it is exemplary only enumerate, in practical application, as needed can also include other attributes and method, herein
It will not enumerate.
Below by taking music application program as an example, it is described as the application program and creates shared drive object and thread pair
The process of elephant.
Music is typically designed to online play mode, i.e. music data is stored in server end, and user is in client
It selects by the way of being played while downloading after certain song, down operation and play operation carry out parallel, and realization is efficient to be broadcast
Put experience.So in realization, application program at least creates two threads, is each responsible for the download of music and the broadcasting of music.
It is the visioning procedure of shared drive object provided by the embodiments of the present application and thread object referring to Fig. 2, such as figure institute
Show, which may include following steps:
Step 201:Load multi-threaded code module (Multi-Thread.addon).
After music application program launching, the main thread loading multi-threaded code module (Multi- of the application program
Thread.addon).The step is optional, for example, multi-threaded code module (Multi-Thread.addon) can be at the beginning of Node.js
It is loaded during beginningization, in this way, after music application program launching, need not just load multi-threaded code module (Multi-
Thread.addon).
Step 202:Shared drive is created for application program based on multi-threaded code module (Multi-Thread.addon)
Object.
In the step, the main thread of music application program is by calling multi-threaded code module (Multi-
Thread.addon the shared drive Object Creation method in) creates shared drive object.The establishment process of shared drive object
Reference can be made to the description of previous embodiment.
In the step, a shared drive object can be created, can also create multiple shared drive objects.
Step 203:Download thread is created for application program based on multi-threaded code module (Multi-Thread.addon)
Object, for down-load music.
In the step, the main thread of music application program is by calling multi-threaded code module (Multi-
Thread.addon the thread object creation method in) creates download thread object.Before the establishment process of thread object can be found in
State the description of embodiment.
Step 204:It is created based on multi-threaded code module (Multi-Thread.addon) for application program and plays thread
Object, for playing music.
In the step, the main thread of music application program is by calling multi-threaded code module (Multi-
Thread.addon the thread object creation method in) creates and plays thread object.Before the establishment process of thread object can be found in
State the description of embodiment.
Start () method is performed after the completion of download thread Object Creation, that is, starts download thread and brings into operation, download thread
The method included in executable download thread object;It plays after the completion of thread object creates and performs start () method, that is, start
It plays thread to bring into operation, plays thread and can perform the method for playing and being included in thread object.
It should be noted that the execution sequence of each step is merely illustrative in above-mentioned flow, the embodiment of the present application is to above-mentioned each
The execution sequence of step is not restricted, for example, the order of step 203 and step 204 can exchange.
It should also be noted that, above-mentioned flow is only described by taking music application program as an example, which needs to create
2 thread objects of music download and music are built, for other applications, greater number of thread can be created as needed
Object.
If thread object to be multiple, can be grouped by the quantity of shared drive object, the thread object of different grouping with not
Same shared drive object associates, and all thread objects in a grouping are associated with same shared drive object.It is in this way, every
The thread corresponding to thread object in a grouping can be shared using same region of memory, and can realize the number between grouping
Isolate according to accessing.
Further, multi-threaded code module (Multi-Thread.addon) may also provide other Object Management group work(
Can, for example Object Query function is provided.
For example, can according to the mark of shared drive object, inquire about corresponding shared drive object with it is properties it
One or combination:
The size of the corresponding region of memory of-shared drive object.
The read-write state of the corresponding region of memory middle finger stator region of-shared drive object, for example the subregion can be inquired about
It is current whether added with read lock or to write lock.
Again for example, the operating status of corresponding thread, such as information trunk according to the mark of thread object, can also be inquired about
Cheng Dangqian is operating status (run), halted state (stop) or halted state (pause).
Further, the Object Management group function that Multi-Thread.addon is provided may also include object and destroy function, than
Such as destroy shared drive object and/or thread object.
The process for being carried out information exchange between thread based on shared drive is described below in conjunction with the accompanying drawings.
For convenience of description, shared drive region is based on first thread object and the second thread object below and carries out information friendship
It is described exemplified by mutually.Wherein, before the creation method of first thread object, the second thread object and shared drive object can be found in
Embodiment is stated, other methods establishment can also be used certainly.Start () method is performed after the completion of first thread Object Creation, that is, is opened
Dynamic first thread brings into operation, and first thread can perform the method included in first thread object;First thread Object Creation is complete
Into rear execution start () method, that is, start the second thread and bring into operation, the second thread can perform to be included in the second thread object
Method.First thread and the second thread can be two threads in same application, such as above-mentioned music application
Download thread and broadcasting thread in program, can also be belonging respectively to different application programs.
Referring to Fig. 3, it is the flow that first thread provided by the embodiments of the present application writes data to shared drive region, such as schemes
Shown, which may include following steps:
Step 310:First thread writes data to shared drive region.
Step 320:Location information of the first thread data to be written in shared drive region is sent to the second thread.
Wherein, first thread is sent to the data positional information of the second thread and may include:The data of first thread write-in exist
Initial position in shared drive region and the region of memory size shared by the data of write-in, so that the second thread is according to this
Location information carries out the reading of data.
According to the description of previous embodiment, message delivery method can be included in thread object, for being transferred between thread
Message, therefore in step 320, first thread can call the message delivery method included in first thread object, by the number of write-in
The second thread is sent to according to the location information in shared drive region.Wherein, the input parameter in message delivery method can wrap
It includes:Location information of the data of mark and the first thread write-in of second thread in shared drive region.
Further, in order to avoid multiple threads are simultaneously written and read shared drive region the caused conflict of operation,
Ensure the safety of data, the embodiment of the present application employs the protection mechanism locked to shared drive region.
Specifically, following steps 305 are can perform before step 310:First thread according to the sizes of data to be written,
Subregion correspondingly sized in shared drive region is added and writes lock, in this way, the thread do not applied to write permission can be blocked to being added
Write lock region of memory write-in data or from by added write lock region of memory read data;After step 310, it can perform step
315:Lock is write added by first thread releasing, other threads limit the read-write in shared drive region with releasing.Certainly, step
315 can also simultaneously can perform after step 320 or with step 320 before step 320, the embodiment of the present application pair
This is not restricted.
Further, first thread can first inquire about the read-write state of the subregion, confirm before being locked to subregion
In the case that the subregion is unlocked, it could apply arriving the write permission to the subregion, so as to be locked to it, otherwise can wait
It treats to apply for write permission next time.
Specifically, before step 305, it may also include step 302:The read-write in first thread inquiry shared drive region
State more specifically, according to the size of data to be written, inquires about the read-write of subregion correspondingly sized in shared drive region
State;Correspondingly, in step 305, if first thread Object Query is not locked to subregion, which is added and writes lock.
Referring to Fig. 4, it is the flow that the second thread provided by the embodiments of the present application reads data from shared drive region, such as schemes
Shown, which may include following steps:
Step 410:The data that the first thread that second thread receives first thread transmission writes in shared drive are altogether
Enjoy the location information in region of memory.
Wherein, the transfer mode of the particular content of the location information and location information is as described above.
Step 420:Second thread reads the number that first thread writes according to the location information from shared drive region
According to.
Further, in order to avoid multiple threads are simultaneously written and read shared drive region the caused conflict of operation,
Ensure the safety of data, the embodiment of the present application employs the protection mechanism locked to shared drive region.
Specifically, following steps 415 are can perform before step 420:Second thread is according to the Data Position received
Information, to respective sub-areas read lock in shared drive region, in this way, any thread can be blocked to by the region of memory of read lock
Write data, i.e. the region of memory is read-only status, and the data of the region of memory can be read in any thread, but cannot be to this
Region of memory writes data;After step 420, it can perform step 425:Second thread releases added read lock, with releasing pair
Other threads limit the read-write in shared drive region.
By above description as can be seen that in above-described embodiment of the application, due to the corresponding memory of shared drive object
Region is located at outside the region of memory that the isolate objects in JavaScript engine are managed, and can be shared by multiple threads
It uses, i.e. multiple threads can be based on the Sharing Memory Realization information exchange, compared to based on isolate Object Creation multithreadings
Between thread caused by more the problem of communication complexity height, inefficiency, using above-described embodiment of the application, in isolate
The region of memory that multithreading object-sharing uses is created outside the region of memory that object is managed, so that different threads are common based on this
It enjoys memory object and realizes information exchange, so as to reduce the complexity of cross-thread communication, and improve communication efficiency.
In order to be more clearly understood that the above-mentioned realization process of the embodiment of the present application, below with foregoing music application program
Exemplified by, the specific implementation process of the embodiment of the present application is described.
After music application program launching, due to the application program need to create at least two sub-line journey (download thread and
Play thread), therefore the main thread loading multi-threaded code module (Multi-Thread.addon) of the application program, so as to base
Thread object and shared drive object are created in the code module, so as to realize line using scheme provided by the embodiments of the present application
Information exchange between journey.Certainly, if the application started can not have to load the code module without multiple sub-line journeys.
It is (following that the main thread of music application program calls shared drive Object Creation method to create shared drive object
Referred to as buffer).The main thread of music application program call thread object creation method create download thread object and
Thread object is played, wherein, music data method for down loading and message delivery method are included at least in download thread object, is played
Method for playing music and message delivery method are included at least in thread object.The creation method of these objects can be found in foregoing implementation
This will not be detailed here for example.
Further, the main thread of music application program can also be by downlink thread object (downloadThread
Object) and play thread object (playerThread objects) associated respectively with shared memory object (buffer objects) so that
DownloadThread objects and playerThread objects can be written and read the corresponding region of memory of buffer objects
Operation.Specifically, the token property values of buffer objects can be assigned to by the main thread of music application program respectively
The BufferToken attributes in BufferToken attributes and playerThread objects in downloadThread objects,
It is associated respectively with buffer objects so as to fulfill downloadThread objects and playerThread objects.
Further, the main thread of music application program can also by downloadThread objects and
PlayerThread objects associate.Specifically, the main thread of music application program can be by playerThread objects
Token property values are assigned to the playerThreadToken attributes in downloadThread objects, so as to fulfill
DownloadThread objects are associated with playerThread objects.
The main thread of music application program performs start () method for downloadThread objects, so as to open
Dynamic download thread (downloadThread), downloadThread can perform the side included in downloadThread objects
Method, since downloadThread objects are associated with buffer objects, downloadThread can also carry out
The method included in buffer objects;The main thread of music application program performs start for playerThread objects
() method plays thread (playerThread) so as to start, and playerThread can perform to be wrapped in playerThread objects
The method contained, since playerThread objects are associated with buffer objects, playerThread can also be held
The method included in row buffer objects.
After downloadThread starts, following operation can be first carried out:
(property value is equal to buffer objects to bufferToken property values in downloadThread objects
Token property values), obtain corresponding region of memory;
(property value is equal to playerThreadToken property values in downloadThread
The token property values of playerThread), obtain corresponding playerThread.
Then, by performing the method down-load music data in downloadThread objects, by performing buffer pairs
Method as in will download the obtained corresponding region of memory of music data write-in bufferToken property values.During being somebody's turn to do,
The data block that downloadThread is every time chunkSize to region of memory write-in size, until obtained institute will be downloaded
There is music data all to write the region of memory.Fig. 5 shows the process of a write operation, as shown in the figure, the mistake of the write operation
Journey may include following steps:
Step 501:The read-write state of the corresponding region of memory of downloadThread inquiry buffer objects, to inquire about
Whether the subregion that initial position is start0 in region of memory, size is chunkSize currently locks.
Step 502:If the subregion that initial position is start0, size is chunkSize is currently unlocked,
DownloadThread calls lockRW () method in buffer objects, which is added and writes lock, obtains write permission.
The value of start parameters in lockRW () method is that the value of start0, size parameter is chunkSize.
Step 503:Buffer objects return to lock objects.
Step 504:DownloadThread calls write () method in buffer objects, and number is write to the subregion
According to.The value of lock parameters in write () method is the title or the lock objects of the lock objects returned in step 503
Token property values (the token property values of lock objects be used for one lock object of unique mark), the value of data parameters be
The binary sequence of voice data to be written.Since lock objects corresponding to initial position are start0, size is
The subregion of chunkSize, therefore voice data can be written to by write () method by the subregion.
Step 505:DownloadThread calls unlock () method in buffer objects, which is solved
Lock discharges write permission.The value of lock parameters in unlock () method is the title of the lock objects returned in step 503
Or the token property values of the lock objects.Since lock objects corresponding to initial position are start0, size chunkSize
Subregion, therefore by unlock () method can will be added on the subregion writing lock release.
Step 506:DownloadThread calls sentMessage () method, this write operation process is write
The location information of subregion where data block is sent to playerThread.Token ginsengs in sentMessage () method
Several values is the token property values of playerThread objects, is wrapped in the messge parameters in sentMessage () method
Include the parameter for representing data positional information:Start0 and chunkSize.
After playerThread starts, following operation can be first carried out:
(property value is equal to buffer objects to bufferToken property values in playerThread objects
Token property values), obtain corresponding region of memory.
Then, the data positional information that playerThread is sent according to downloadThread, from the region of memory
In corresponding position read and data and play out.Fig. 6 shows the process of a read operation, as shown in the figure, the read operation
Process may include following steps:
Step 601:PlayerThread calls lockRD () method in buffer objects, to the subregion read lock,
Obtain read right.The value of start parameters in lockRD () method is that the value of start0, size parameter is
chunkSize。
Step 602:Buffer objects return to lock objects.
Step 603:PlayerThread calls read () method in buffer objects, according to location information from corresponding
Subregion reads data.The value of lock parameters in read () method be the title of lock objects that is returned in step 602 or
The token property values (the token property values of lock objects are used for one lock object of unique mark) of the lock objects, data ginsengs
Several values is sky.Since lock objects correspond to the subregion that initial position is start0, size is chunkSize,
Voice data can be read from the subregion by read () method, and the voice data read is assigned to data parameters and is returned
It returns.
Step 604:The data that buffer objects are read to playerThread returns, the data can be assigned to output
Parameter data is returned.
Step 605:PlayerThread calls unlock () method in buffer objects, which is solved
Lock discharges read right.PlayerThread can play the music data read.Lock parameters in unlock () method
Value is the title of lock objects or the token property values of the lock objects returned in step 602.Since lock objects correspond to
The son can will be added in the subregion that initial position is start0, size is chunkSize, therefore by unlock () method
Read lock on region releases.
By above description as can be seen that in above-described embodiment of the application, due to the corresponding memory of shared drive object
Region is different from the region of memory that the memory management object in dynamic language engine is managed, and can be shared and make by multiple threads
With, i.e. multiple threads can be based on the corresponding region of memory of the shared drive object and realize information exchange, compared to based on dynamic language
Between the thread caused by memory management Object Creation multithreading in speech engine the problem of communication complexity height, inefficiency,
It is created outside the region of memory managed using above-described embodiment of the application, the memory management object in dynamic language engine
The region of memory that multithreading object-sharing uses, so that different threads are based on the shared drive object implementatio8 information exchange, so as to
The complexity of cross-thread communication is reduced, and improves communication efficiency.
Based on identical technical concept, the embodiment of the present application additionally provides a kind of Object Management group device, which can realize
The Object Management group function of previous embodiment description.
Referring to Fig. 7, for the structure diagram of Object Management group device provided by the embodiments of the present application, which may include:Altogether
Memory object management module 701, thread object management module 702 are enjoyed, wherein:
Shared drive object management module 701, for creating shared drive object, the shared drive object is corresponding interior
It is different from the region of memory that the memory management object in dynamic language engine is managed to deposit region, and the memory management object is used for
Manage region of memory used in thread;Thread object management module 702, for creating thread object, the thread object with
The shared drive object association uses the shared drive object corresponding so that the corresponding thread of the thread object is shared
Region of memory.
Optionally, thread object includes memory attribute, and the shared drive object includes shared drive object identity
Attribute;Thread object management module 702 is specifically used for:By the value of the memory attribute in the thread object, be arranged to it is described
The value of shared drive object identity attribute in shared drive object is identical.
Optionally, included in the shared drive object with properties:Shared drive object identity, is total to for unique mark
Enjoy memory object.Following methods are included in shared drive object:
Data writing method, for writing data to the corresponding region of memory of shared drive object;
Data reading method, for reading data from the corresponding region of memory of shared drive object.
Further, following methods are further included in the shared drive object:
Add and write locking method, for the specified son in the corresponding region of memory of the shared drive object or the region of memory
Region, which adds, writes lock, and the thread of write permission is not obtained to being added the region of memory for writing lock write-in data or write lock from being added with obstruction
Region of memory reads data;
Unlocking method added writes lock for releasing.
Wherein, input parameter that is described plus writing locking method includes:The specified subregion is in the shared drive object pair
The size of initial position and the specified subregion in the region of memory answered.
Optionally, following methods are further included in the shared drive object:
Read lock method, for the specified son in the corresponding region of memory of the shared drive object or the region of memory
Region read lock writes number to block other threads in addition to the read lock method is called to by the region of memory of read lock
According to;
Unlocking method, for releasing added read lock.
Wherein, the input parameter of the read lock method includes:The specified subregion is in the shared drive object pair
The size of initial position and the specified subregion in the region of memory answered.
Optionally, the thread object is included with properties:Thread object identifies, for unique mark thread object.
The thread object includes following methods:Message delivery method, for transferring message between thread object.
Wherein, the message delivery method includes following input parameter:The mark of subject thread, passes to subject thread
Message content.
Optionally, code library load-on module 703 is further included, for loading code storehouse, the code library includes:For creating
Build the code of shared drive object and corresponding first interface and for creating the code of thread object and corresponding
Two interfaces;
Shared drive object management module 701 is specifically used for:The first interface is called, establishment obtains shared drive pair
As;Thread object management module 702 is specifically used for:The second interface is called, establishment obtains thread object.Wherein, in sharing
When depositing object management module 701 and calling the first interface, following operation is performed:
Using original allocation region of memory size and reserved region of memory size as input parameter, so as to create being total to of obtaining
It is identical with the original allocation region of memory size to enjoy the size of the region of memory corresponding to memory object, and in described share
It is identical with the reserved region of memory size to deposit the region of memory size that object is reserved;Alternatively,
Using original allocation region of memory size as input parameter, so as to create corresponding to obtained shared drive object
The size of region of memory is identical with the original allocation region of memory size;Alternatively,
Using reserved region of memory size as input parameter, so as to create the memory corresponding to obtained shared drive object
The size in region is identical with the region of memory size of default setting, and the region of memory size reserved for the shared drive object
It is identical with the reserved region of memory size.
Optionally, the quantity for the shared drive object that shared drive object management module 701 is created is one or more;
Thread object management module 702 is additionally operable to:If the quantity for the shared drive object that shared drive object management module 701 is created
To be multiple, then the thread object created is grouped, the thread object in each grouping is associated with a shared drive object, no
It is different from each other with the shared drive object associated by the thread object of grouping.
Based on identical technical concept, the embodiment of the present application additionally provides a kind of information interactive device, which can realize
The information exchange flow of first thread in previous embodiment.
Referring to Fig. 8, for the structure diagram of information interactive device provided by the embodiments of the present application.The device may include:It writes
Operation module 801, interactive module 802, wherein:
Write operation module 801, for writing data to shared drive region;Wherein, the shared drive region and dynamic
The region of memory that memory management object in language engine is managed is different, and use, the memory can be shared by multiple threads
Management object is used to manage region of memory used in thread;
Interactive module 802 is sent to second for location information of the data to be written in the shared drive region
Thread.
Optionally, the location information, including:The data of the write operation module write-in are in the shared drive region
Initial position and write-in data shared by region of memory size.
Optionally, interactive module 802 is specifically used for:By performing the message delivery method defined in first thread object,
Location information of the data to be written in the shared drive region is sent to the second thread;Wherein, using following parameter as
The input parameter of the message delivery method:The data of mark and the first thread write-in of second thread are in the shared drive
Location information in region.
Optionally, write operation module 801 is additionally operable to:Before writing data to shared drive region, according to data to be written
Size, obtain the write permission to subregion correspondingly sized in the shared drive region;Number is write to shared drive region
According to the write permission afterwards, released to the subregion.
Optionally, write operation module 801 is specifically used for:By performing in memory management object plus writing locking method, to institute
State in shared drive region with data to be written shared by the correspondingly sized subregion of size add and write lock;Wherein, data are written into
Size as described plus write the input parameter of locking method;By performing the unlocking method in the memory management object, release
Added writes lock;Wherein, the lock object for writing locking method return is added as the input parameter of the unlocking method, the lock using described
Object, which is used to indicate, has added the region of memory for writing lock.
Based on identical technical concept, the embodiment of the present application additionally provides a kind of information interactive device, which can realize
The information exchange flow of second thread in previous embodiment.
Referring to Fig. 9, for the structure diagram of information interactive device provided by the embodiments of the present application, which may include:It hands over
Mutual module 901, read operation module 902, wherein:
Interactive module 901, the data that the first thread for receiving first thread transmission writes in shared drive
Location information in the shared drive region;Wherein, the region of memory and the memory management pair in dynamic language engine
As the region of memory difference managed, and use can be shared by multiple threads, the memory management object is used to manage thread institute
The region of memory used;
Read operation module 902, for according to the location information, the First Line to be read from the shared drive region
The data of journey write-in.
Optionally, the location information, including:The data of the first thread write-in are in the shared drive region
Region of memory size shared by the data of initial position and write-in.
Optionally, interactive module 901 is specifically used for:The message that the first thread is sent is received, is carried in the message
There is location information of the data of the first thread write-in in the shared drive region.
Optionally, read operation module 902 is additionally operable to:According to the location information, read from the shared drive region
Before the data of the first thread write-in, according to the location information, obtain to corresponding sub-district in the shared drive region
The read right in domain;After the data that the first thread write-in is read from the shared drive region, the sub-district is released
The read right in domain.
Optionally, read operation module 902 is specifically used for:By performing the read lock method in memory management object, to institute
State subregion read lock correspondingly sized in shared drive region;Wherein, using the location information as the read lock method
Input parameter;By performing the unlocking method in the memory management object, added read lock is released;Wherein, described will add
Input parameter of the lock object that read lock method returns as the unlocking method, the lock object, which is used to indicate, has added the interior of write-read
Deposit region.
Based on identical technical concept, the embodiment of the present application additionally provides a kind of computer equipment, which can
Realize the information exchange flow of previous embodiment description.
Referring to Figure 10, for the structure diagram of computer equipment provided by the embodiments of the present application, which can be real
The information exchange flow of existing previous embodiment description, the computer equipment may include on the whole:Processor 1001, memory
1002, it further may also include display 1003.
Wherein, processor 1001 can be general processor (such as microprocessor or any conventional processor etc.),
Digital signal processor, application-specific integrated circuit, field programmable gate array either other programmable logic device, discrete gate or
Transistor logic, discrete hardware components.Memory 1002 specifically may include internal storage and/or external memory, than
Such as random access memory, flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register
Wait the storage medium of this fields maturation.
There are data communication connection between processor 1001 and other each modules, for example bus architecture can be based on and carry out data
Communication.Bus architecture can include the bus and bridge of any number of interconnection, one or more specifically represented by processor 1001
The various circuits for the memory that a processor and memory 1002 represent link together.Bus architecture can also will be such as peripheral
Various other circuits of equipment, voltage-stablizer and management circuit or the like link together, these are all well known in the art
, therefore, no longer it is described further herein.Bus interface provides interface.Processor 1001 is responsible for total coil holder
Structure and common processing, memory 1002 can store the used data when performing operation of processor 1001.
The flow that the embodiment of the present application discloses, can be applied to realize in processor 1001 or by processor 1001.
During realization, each step can be complete by the integrated logic circuit of the hardware in processor 1001 or the instruction of software form
Into.It can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present application.Implement with reference to the application
The step of method disclosed in example, can be embodied directly in hardware processor and perform completion or with the hardware in processor and soft
Part block combiner performs completion.Software module can be located at random access memory, and flash memory, read-only memory may be programmed read-only storage
In the storage medium of this fields such as device or electrically erasable programmable memory, register maturation.
Specifically, memory 1002 is coupled in processor 1001, for reading the computer program of the storage of memory 1002
Instruction, and in response, perform following operation:
First thread writes data to shared drive region;Wherein, in the shared drive region and dynamic language engine
The region of memory that is managed of memory management object it is different, and uses can be shared by multiple threads, the memory management object use
In region of memory used in management thread;Location information of the first thread data to be written in the shared drive region
It is sent to the second thread.
Optionally, in processor 1001, first thread can be by performing the message transmission side defined in first thread object
Method, location information of the data to be written in the shared drive region are sent to the second thread;Wherein, the first thread
Using following parameter as the input parameter of the message delivery method:The data of mark and the first thread write-in of second thread
Location information in the shared drive region.
Optionally, in processor 1001, before first thread writes data to shared drive region, further include:According to treating
The size of data is write, the write permission to subregion correspondingly sized in the shared drive region is obtained, to shared section key
After domain write-in data, further include:Release the write permission to the subregion.
Optionally, in processor 1001, first thread can be by performing in memory management object plus writing locking method, to institute
State in shared drive region with data to be written shared by the correspondingly sized subregion of size add and write lock;Wherein, the first thread
The size for being written into data adds the input parameter for writing locking method as described in;First thread can be by performing the memory management
Unlocking method in object releases and added writes lock;Wherein, the first thread by it is described plus write locking method return lock object
As the input parameter of the unlocking method, the lock object, which is used to indicate, has added the region of memory for writing lock.
Optionally, in processor 1001, first thread obtains writing to subregion correspondingly sized in shared drive region
Before permission, the read-write state of subregion described in shared drive region can be also inquired about, if first thread inquires the sub-district
Domain does not obtain write permission by other threads, then obtains the write permission to the subregion.
The specific implementation of the above process can be found in previous embodiment, be not repeated herein.
Based on identical technical concept, the embodiment of the present application additionally provides a kind of operating system.
It is the structure diagram of operating system provided by the embodiments of the present application, as shown in the figure, the operating system referring to Figure 11
It can be abstracted as with lower structure:Ccf layer and system kernel when application layer, operation, wherein:
Include during the operation in ccf layer comprising dynamic language engine and code library, the code library:For creating
Build the code of shared drive object and the code for creating thread object;It is used to create shared drive object by described
The shared drive object that is created of code, corresponding to region of memory and the memory management object institute in dynamic language engine
The region of memory of management is different, and the memory management object is used to manage region of memory used in thread;It is used for by described
The code for creating thread object creates thread object, is associated with the shared drive object, so that the thread object corresponds to
Thread share using the corresponding region of memory of the shared drive object.
The application is with reference to the flow according to the method for the embodiment of the present application, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, those skilled in the art once know basic creation
Property concept, then can make these embodiments other change and modification.So appended claims be intended to be construed to include it is excellent
It selects embodiment and falls into all change and modification of the application scope.
Obviously, those skilled in the art can carry out the application essence of the various modification and variations without departing from the application
God and scope.In this way, if these modifications and variations of the application belong to the scope of the application claim and its equivalent technologies
Within, then the application is also intended to comprising including these modification and variations.
Claims (47)
1. a kind of information interacting method, which is characterized in that the described method includes:
First thread writes data to shared drive region;Wherein, the shared drive region with it is interior in dynamic language engine
It is different to deposit the region of memory that management object is managed, and use can be shared by multiple threads, the memory management object is used to manage
Region of memory used in lineation journey;
Location information of the first thread data to be written in the shared drive region is sent to the second thread.
2. the method as described in claim 1, which is characterized in that the location information, including:
Shared by the data of initial position and write-in of the data of the first thread write-in in the shared drive region
Region of memory size.
3. the method as described in claim 1, which is characterized in that the first thread data to be written is in the shared drive
Location information in region is sent to the second thread, including:
First thread is by performing the message delivery method defined in first thread object, and data to be written is described shared interior
It deposits the location information in region and is sent to the second thread;Wherein, the first thread is using following parameter as the message transmission
The input parameter of method:Position of the data of mark and the first thread write-in of second thread in the shared drive region
Information.
4. method as claimed any one in claims 1 to 3, which is characterized in that the first thread is to shared drive region
It writes before data, further includes:
The first thread is obtained according to the size of data to be written to subregion correspondingly sized in the shared drive region
Write permission;
After the first thread writes data to shared drive region, further include:
The first thread releases the write permission to the subregion.
5. method as claimed in claim 4, which is characterized in that the first thread is obtained according to the size of data to be written
To the write permission of subregion correspondingly sized in the shared drive region, including:
The first thread by perform in memory management object plus write locking method, in the shared drive region with it is to be written
Enter the correspondingly sized subregion of size shared by data and add to write lock;Wherein, the first thread is written into the size conduct of data
Input parameter that is described plus writing locking method;
The first thread releases the write permission to the subregion, including:
The first thread is released and added writes lock by performing the unlocking method in the memory management object;Wherein, it is described
The input parameter for adding and writing the lock object of locking method return as the unlocking method, the lock object are used for by first thread
It indicates to have added the region of memory for writing lock.
6. method as claimed in claim 4, which is characterized in that first thread is obtained to correspondingly sized in shared drive region
Before the write permission of subregion, further include:
The read-write state of subregion described in the first thread inquiry shared drive region;
The first thread obtains the write permission to subregion correspondingly sized in shared drive region, including:
If the first thread inquires the subregion and do not obtain write permission by other threads, obtain to the subregion
Write permission.
7. a kind of information interacting method, which is characterized in that the described method includes:
The data that the first thread that second thread receives first thread transmission writes in shared drive are described shared interior
Deposit the location information in region;Wherein, the region of memory is managed interior with the memory management object in dynamic language engine
Region difference is deposited, and use can be shared by multiple threads, the memory management object is used to manage memory field used in thread
Domain;
Second thread reads the number that the first thread writes according to the location information from the shared drive region
According to.
8. the method for claim 7, which is characterized in that the location information, including:
Shared by the data of initial position and write-in of the data of the first thread write-in in the shared drive region
Region of memory size.
9. the method for claim 7, which is characterized in that the second thread receives the first thread that first thread is sent
Location information of the data write in shared drive in the shared drive region, including:
Second thread receives the message that the first thread is sent, and the first thread write-in is carried in the message
Location information of the data in the shared drive region.
10. the method as any one of claim 7 to 9, which is characterized in that second thread is believed according to the position
Breath before the data that the first thread writes are read from the shared drive region, further includes:
Second thread obtains the read right to respective sub-areas in the shared drive region according to the location information;
After second thread reads the data of the first thread write-in from the shared drive region, further include:
Second thread releases the read right of the subregion.
11. method as claimed in claim 10, which is characterized in that second thread is according to the location information, acquisition pair
The read right of correspondingly sized subregion in the shared drive region, including:
Second thread is by performing the read lock method in memory management object, to corresponding big in the shared drive region
Small subregion read lock;Wherein, second thread is using the location information as the input parameter of the read lock method;
Second thread releases the read right to the subregion, including:
Second thread releases added read lock by performing the unlocking method in the memory management object;Wherein, it is described
Using the lock object that the read lock method returns as the input parameter of the unlocking method, the lock object is used for second thread
Indicate the region of memory for having added write-read.
12. a kind of method for managing object, which is characterized in that including:
Create shared drive object, the corresponding region of memory of the shared drive object and the memory management in dynamic language engine
The region of memory that object is managed is different, and the memory management object is used to manage region of memory used in thread;
Thread object is created, the thread object is associated with the shared drive object, so that the corresponding line of the thread object
Journey is shared using the corresponding region of memory of the shared drive object.
13. method as claimed in claim 12, which is characterized in that the thread object includes memory attribute, described shared
Memory object includes shared drive object identity attribute;
In the following manner, the thread object is associated with the shared drive object:
By the value of the memory attribute in the thread object, it is arranged to and the shared drive object mark in the shared drive object
The value for knowing attribute is identical.
14. method as described in claim 12 or 13, which is characterized in that included in the shared drive object with properties:
Shared drive object identity, for unique mark shared drive object;
Following methods are included in the shared drive object:
Data writing method, for writing data to the corresponding region of memory of shared drive object;
Data reading method, for reading data from the corresponding region of memory of shared drive object.
15. method as claimed in claim 14, which is characterized in that further include following methods in the shared drive object:
Add and write locking method, for the specified subregion in the corresponding region of memory of the shared drive object or the region of memory
Add and write lock, the thread of write permission is not obtained to being added the region of memory for writing lock write-in data or from being added the memory for writing lock with obstruction
Regional sensed data;
Unlocking method added writes lock for releasing.
16. method as claimed in claim 15, which is characterized in that input parameter that is described plus writing locking method includes:The finger
Initial position and the specified subregion of the stator region in the corresponding region of memory of the shared drive object it is big
It is small.
17. method as claimed in claim 14, which is characterized in that further include following methods in the shared drive object:
Read lock method, for the specified subregion in the corresponding region of memory of the shared drive object or the region of memory
Read lock writes data to block other threads in addition to the read lock method is called to by the region of memory of read lock;
Unlocking method, for releasing added read lock.
18. method as claimed in claim 17, which is characterized in that the input parameter of the read lock method includes:The finger
Initial position and the specified subregion of the stator region in the corresponding region of memory of the shared drive object it is big
It is small.
19. method as described in claim 12 or 13, which is characterized in that the thread object is included with properties:
Thread object identifies, for unique mark thread object;
The thread object includes following methods:
Message delivery method, for transferring message between thread object.
20. method as claimed in claim 19, which is characterized in that the message delivery method includes following input parameter:
The mark of subject thread;
Pass to the message content of subject thread.
21. method as claimed in claim 12, which is characterized in that further include:Loading code storehouse, the code library include:
For creating the code of shared drive object and corresponding first interface and for creating the code of thread object and right
The second interface answered;
Shared drive object is created, including:The first interface is called, establishment obtains shared drive object;
Thread object is created, including:The second interface is called, establishment obtains thread object.
22. method as claimed in claim 21, which is characterized in that by original allocation region of memory when calling the first interface
Size and reserved region of memory size are as input parameter, so as to create the region of memory corresponding to obtained shared drive object
Size it is identical with the original allocation region of memory size, and the region of memory size reserved for the shared drive object with
The reserved region of memory size is identical;Alternatively,
Using original allocation region of memory size as input parameter when calling the first interface so that create obtain it is shared in
The size for depositing the region of memory corresponding to object is identical with the original allocation region of memory size;Alternatively,
Using reserved region of memory size as input parameter when calling the first interface, so as to create obtained shared drive pair
It is reserved as the size of corresponding region of memory and the region of memory size of default setting are identical, and for the shared drive object
Region of memory size it is identical with the reserved region of memory size.
23. method as claimed in claim 12, which is characterized in that after creating shared drive object, further include:
The all or part of region of memory that will be reserved for the shared drive object distribute to the shared drive object.
24. method as claimed in claim 12, which is characterized in that the quantity of the shared drive object created is one or more
It is a;
If the quantity of the shared drive object created is multiple, the thread object created is grouped, in each grouping
Thread object is associated with a shared drive object, and the shared drive object associated by the thread object of different grouping is each other not
Together.
25. a kind of information interactive device, which is the corresponding device of first thread object, which is characterized in that including:
Write operation module, for writing data to shared drive region;Wherein, the shared drive region and dynamic language engine
In the region of memory that is managed of memory management object it is different, and use, the memory management object can be shared by multiple threads
For managing region of memory used in thread;
Interactive module is sent to the second thread for location information of the data to be written in the shared drive region.
26. device as claimed in claim 25, which is characterized in that the location information, including:
Shared by the data of initial position and write-in of the data of the write operation module write-in in the shared drive region
Region of memory size.
27. device as claimed in claim 25, which is characterized in that the interactive module is specifically used for:
By performing the message delivery method defined in first thread object, data to be written is in the shared drive region
Location information be sent to the second thread;Wherein, using following parameter as the input parameter of the message delivery method:Second line
Location information of the data of mark and the first thread write-in of journey in the shared drive region.
28. the device as any one of claim 25 to 27, which is characterized in that the write operation module is additionally operable to:
Before writing data to shared drive region, according to the size of data to be written, obtain in the shared drive region
The write permission of correspondingly sized subregion;
After writing data to shared drive region, the write permission to the subregion is released.
29. device as claimed in claim 28, which is characterized in that the write operation module is specifically used for:
By performing in memory management object plus writing locking method, in the shared drive region with data to be written shared by it is big
Small correspondingly sized subregion, which adds, writes lock;Wherein, the size for being written into data adds the input parameter for writing locking method as described in;
By performing the unlocking method in the memory management object, release and added write lock;It wherein, will be described plus write locking method
Input parameter of the lock object of return as the unlocking method, the lock object, which is used to indicate, has added the region of memory for writing lock.
30. a kind of information interactive device, which is the corresponding device of the second thread object, which is characterized in that including:
Interactive module, the data that the first thread for receiving first thread transmission writes in shared drive are described common
Enjoy the location information in region of memory;Wherein, the region of memory is managed with the memory management object in dynamic language engine
Region of memory it is different, and uses can be shared by multiple threads, the memory management object is interior used in thread for managing
Deposit region;
Read operation module, for according to the location information, the first thread write-in to be read from the shared drive region
Data.
31. device as claimed in claim 30, which is characterized in that the location information, including:
Shared by the data of initial position and write-in of the data of the first thread write-in in the shared drive region
Region of memory size.
32. device as claimed in claim 30, which is characterized in that the interactive module is specifically used for:
The message that the first thread is sent is received, the data of the first thread write-in are carried in the message described common
Enjoy the location information in region of memory.
33. the device as any one of claim 30 to 32, which is characterized in that the read operation module is additionally operable to:
According to the location information, before the data that the first thread write-in is read from the shared drive region, according to
The location information obtains the read right to respective sub-areas in the shared drive region;
After the data that the first thread write-in is read from the shared drive region, the reading power of the subregion is released
Limit.
34. device as claimed in claim 33, which is characterized in that the read operation module is specifically used for:
By performing the read lock method in memory management object, subregion correspondingly sized in the shared drive region is added
Read lock;Wherein, using the location information as the input parameter of the read lock method;
By performing the unlocking method in the memory management object, added read lock is released;Wherein, by the read lock method
Input parameter of the lock object of return as the unlocking method, the lock object are used to indicate the region of memory for having added write-read.
35. a kind of Object Management group device, which is characterized in that including:
Shared drive object management module, for creating shared drive object, the corresponding region of memory of the shared drive object
Different from the region of memory that the memory management object in dynamic language engine is managed, the memory management object is used to manage line
Region of memory used in journey;
Thread object management module, for creating thread object, the thread object is associated with the shared drive object, so that
The corresponding thread of the thread object is shared using the corresponding region of memory of the shared drive object.
36. device as claimed in claim 35, which is characterized in that the thread object includes memory attribute, described shared
Memory object includes shared drive object identity attribute;
The thread object management module is specifically used for:By the value of the memory attribute in the thread object, be arranged to it is described
The value of shared drive object identity attribute in shared drive object is identical.
37. the device as described in claim 35 or 36, which is characterized in that included in the shared drive object with properties:
Shared drive object identity, for unique mark shared drive object;
Following methods are included in the shared drive object:
Data writing method, for writing data to the corresponding region of memory of shared drive object;
Data reading method, for reading data from the corresponding region of memory of shared drive object.
38. device as claimed in claim 37, which is characterized in that further include following methods in the shared drive object:
Add and write locking method, for the specified subregion in the corresponding region of memory of the shared drive object or the region of memory
Add and write lock, the thread of write permission is not obtained to being added the region of memory for writing lock write-in data or from being added the memory for writing lock with obstruction
Regional sensed data;
Unlocking method added writes lock for releasing.
39. device as claimed in claim 38, which is characterized in that input parameter that is described plus writing locking method includes:The finger
Initial position and the specified subregion of the stator region in the corresponding region of memory of the shared drive object it is big
It is small.
40. device as claimed in claim 37, which is characterized in that further include following methods in the shared drive object:
Read lock method, for the specified subregion in the corresponding region of memory of the shared drive object or the region of memory
Read lock writes data to block other threads in addition to the read lock method is called to by the region of memory of read lock;
Unlocking method, for releasing added read lock.
41. device as claimed in claim 40, which is characterized in that the input parameter of the read lock method includes:The finger
Initial position and the specified subregion of the stator region in the corresponding region of memory of the shared drive object it is big
It is small.
42. the device as described in claim 35 or 36, which is characterized in that the thread object is included with properties:
Thread object identifies, for unique mark thread object;
The thread object includes following methods:
Message delivery method, for transferring message between thread object.
43. device as claimed in claim 42, which is characterized in that the message delivery method includes following input parameter:
The mark of subject thread;
Pass to the message content of subject thread.
44. device as claimed in claim 35, which is characterized in that further include:
Code library load-on module, for loading code storehouse, the code library includes:For creating the code of shared drive object
And corresponding first interface and for creating the code of thread object and corresponding second interface;
The shared drive object management module is specifically used for:The first interface is called, establishment obtains shared drive object;
The memory object management module is specifically used for:The second interface is called, establishment obtains thread object;
Wherein, when the shared drive object management module calls the first interface, following operation is performed:
Using original allocation region of memory size and reserved region of memory size as input parameter so that create obtain it is shared in
It is identical with the original allocation region of memory size to deposit the size of the region of memory corresponding to object, and is the shared drive pair
As reserved region of memory size is identical with the reserved region of memory size;Alternatively,
Using original allocation region of memory size as input parameter, so as to create the memory corresponding to obtained shared drive object
The size in region is identical with the original allocation region of memory size;Alternatively,
Using reserved region of memory size as input parameter, so as to create the region of memory corresponding to obtained shared drive object
Size it is identical with the region of memory size of default setting, and the region of memory size reserved for the shared drive object and institute
It is identical to state reserved region of memory size.
45. device as claimed in claim 35, which is characterized in that the shared drive object management module is created shared
The quantity of memory object is one or more;
The thread object management module is additionally operable to:If the shared drive object that the shared drive object management module is created
Quantity to be multiple, then the thread object created is grouped, thread object and a shared drive object in each grouping
Association, the shared drive object associated by the thread object of different grouping are different from each other.
46. a kind of operating system, which is characterized in that including:Ccf layer and system kernel when application layer, operation;
Include during the operation in ccf layer comprising dynamic language engine and code library, the code library:For creating altogether
Enjoy the code of memory object and the code for creating thread object;
By described for creating the shared drive object that the code of shared drive object created, corresponding to region of memory
Different from the region of memory that the memory management object in dynamic language engine is managed, the memory management object is used to manage line
Region of memory used in journey;
Thread object is created for creating the code of thread object by described, is associated with the shared drive object, so that
The corresponding thread of the thread object is shared using the corresponding region of memory of the shared drive object.
47. a kind of computer equipment, which is characterized in that including:Processor, memory;
Memory, for storing computer program instructions;
Processor is coupled to the memory, for reading the computer program instructions of the memory storage, and as sound
Should, perform following operation:
First thread writes data to shared drive region;Wherein, the shared drive region with it is interior in dynamic language engine
It is different to deposit the region of memory that management object is managed, and use can be shared by multiple threads, the memory management object is used to manage
Region of memory used in lineation journey;
Location information of the first thread data to be written in the shared drive region is sent to the second thread.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610983813.6A CN108062252B (en) | 2016-11-08 | 2016-11-08 | Information interaction method, object management method, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610983813.6A CN108062252B (en) | 2016-11-08 | 2016-11-08 | Information interaction method, object management method, device and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108062252A true CN108062252A (en) | 2018-05-22 |
CN108062252B CN108062252B (en) | 2022-02-01 |
Family
ID=62136851
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610983813.6A Active CN108062252B (en) | 2016-11-08 | 2016-11-08 | Information interaction method, object management method, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108062252B (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109739583A (en) * | 2018-12-13 | 2019-05-10 | 平安科技(深圳)有限公司 | Method, apparatus, computer equipment and the storage medium of multi-threaded parallel operation |
CN109947572A (en) * | 2019-03-25 | 2019-06-28 | Oppo广东移动通信有限公司 | Communication control method, device, electronic equipment and storage medium |
CN110399235A (en) * | 2019-07-16 | 2019-11-01 | 阿里巴巴集团控股有限公司 | Multi-thread data transmission method and device in TEE system |
CN110442462A (en) * | 2019-07-16 | 2019-11-12 | 阿里巴巴集团控股有限公司 | Multi-thread data transmission method and device in TEE system |
CN111114320A (en) * | 2019-12-27 | 2020-05-08 | 深圳市众鸿科技股份有限公司 | Vehicle-mounted intelligent cabin sharing display method and system |
CN111324461A (en) * | 2020-02-20 | 2020-06-23 | 西安芯瞳半导体技术有限公司 | Memory allocation method and device, computer equipment and storage medium |
CN111538585A (en) * | 2019-12-31 | 2020-08-14 | 浙江明度智控科技有限公司 | Js-based server process scheduling method, system and device |
CN111796931A (en) * | 2020-06-09 | 2020-10-20 | 阿里巴巴集团控股有限公司 | Information processing method, device, computing equipment and medium |
CN112181679A (en) * | 2020-09-13 | 2021-01-05 | 中国运载火箭技术研究院 | Rocket data processing method and device, computer storage medium and electronic equipment |
CN112187887A (en) * | 2020-09-14 | 2021-01-05 | 北京三快在线科技有限公司 | Webpage real-time communication method and device for multiple pages and electronic equipment |
CN112597162A (en) * | 2020-12-25 | 2021-04-02 | 平安银行股份有限公司 | Data set acquisition method, system, device and storage medium |
CN112822193A (en) * | 2021-01-05 | 2021-05-18 | 网易(杭州)网络有限公司 | Application communication method, device, equipment and storage medium |
US11042642B2 (en) | 2019-07-16 | 2021-06-22 | Advanced New Technologies Co., Ltd. | Method and apparatus for data transmission in a TEE system |
CN117077115A (en) * | 2023-10-13 | 2023-11-17 | 沐曦集成电路(上海)有限公司 | Cross-language multi-process interaction method, electronic equipment and medium in chip verification stage |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040133744A1 (en) * | 2003-01-07 | 2004-07-08 | Van Doren Stephen R. | System and method for avoiding deadlock |
CN1740978A (en) * | 2004-08-23 | 2006-03-01 | 华为技术有限公司 | Method for realing sharing internal stored data base and internal stored data base system |
CN101504617A (en) * | 2009-03-23 | 2009-08-12 | 华为技术有限公司 | Data transmitting and receiving method and device based on processor sharing internal memory |
CN103034544A (en) * | 2012-12-04 | 2013-04-10 | 杭州迪普科技有限公司 | Management method and device for user mode and kernel mode to share memory |
CN103176852A (en) * | 2011-12-22 | 2013-06-26 | 腾讯科技(深圳)有限公司 | Method and device for inter-progress communication |
CN103514053A (en) * | 2013-09-22 | 2014-01-15 | 中国科学院信息工程研究所 | Shared-memory-based method for conducting communication among multiple processes |
CN104572313A (en) * | 2013-10-22 | 2015-04-29 | 华为技术有限公司 | Inter-process communication method and device |
CN105843693A (en) * | 2016-03-22 | 2016-08-10 | 同济大学 | High-speed maglev transportation simulation oriented memory sharing method |
-
2016
- 2016-11-08 CN CN201610983813.6A patent/CN108062252B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040133744A1 (en) * | 2003-01-07 | 2004-07-08 | Van Doren Stephen R. | System and method for avoiding deadlock |
CN1740978A (en) * | 2004-08-23 | 2006-03-01 | 华为技术有限公司 | Method for realing sharing internal stored data base and internal stored data base system |
CN101504617A (en) * | 2009-03-23 | 2009-08-12 | 华为技术有限公司 | Data transmitting and receiving method and device based on processor sharing internal memory |
CN103176852A (en) * | 2011-12-22 | 2013-06-26 | 腾讯科技(深圳)有限公司 | Method and device for inter-progress communication |
CN103034544A (en) * | 2012-12-04 | 2013-04-10 | 杭州迪普科技有限公司 | Management method and device for user mode and kernel mode to share memory |
CN103514053A (en) * | 2013-09-22 | 2014-01-15 | 中国科学院信息工程研究所 | Shared-memory-based method for conducting communication among multiple processes |
CN104572313A (en) * | 2013-10-22 | 2015-04-29 | 华为技术有限公司 | Inter-process communication method and device |
CN105843693A (en) * | 2016-03-22 | 2016-08-10 | 同济大学 | High-speed maglev transportation simulation oriented memory sharing method |
Non-Patent Citations (2)
Title |
---|
MUTLU ARPACI;JOHN A. COPELAND: "Buffer management for shared-memory ATM switches", 《COMMUNICATIONS SURVEYS AND TUTORIALS》 * |
高珂,陈荔城,范东睿,刘志勇: "多核系统共享内存资源分配和管理研究", 《计算机学报》 * |
Cited By (26)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109739583A (en) * | 2018-12-13 | 2019-05-10 | 平安科技(深圳)有限公司 | Method, apparatus, computer equipment and the storage medium of multi-threaded parallel operation |
CN109739583B (en) * | 2018-12-13 | 2023-09-08 | 平安科技(深圳)有限公司 | Method, device, computer equipment and storage medium for parallel running of multiple threads |
CN109947572A (en) * | 2019-03-25 | 2019-06-28 | Oppo广东移动通信有限公司 | Communication control method, device, electronic equipment and storage medium |
CN109947572B (en) * | 2019-03-25 | 2023-09-05 | Oppo广东移动通信有限公司 | Communication control method, device, electronic equipment and storage medium |
US10896075B1 (en) | 2019-07-16 | 2021-01-19 | Advanced New Technologies Co., Ltd. | Method and apparatus for multithreaded data transmission in a TEE system |
CN110442462A (en) * | 2019-07-16 | 2019-11-12 | 阿里巴巴集团控股有限公司 | Multi-thread data transmission method and device in TEE system |
CN110399235B (en) * | 2019-07-16 | 2020-07-28 | 阿里巴巴集团控股有限公司 | Multithreading data transmission method and device in TEE system |
CN110399235A (en) * | 2019-07-16 | 2019-11-01 | 阿里巴巴集团控股有限公司 | Multi-thread data transmission method and device in TEE system |
US11042642B2 (en) | 2019-07-16 | 2021-06-22 | Advanced New Technologies Co., Ltd. | Method and apparatus for data transmission in a TEE system |
US10943006B2 (en) | 2019-07-16 | 2021-03-09 | Advanced New Technologies Co., Ltd. | Method and apparatus for multithreaded data transmission in a TEE system |
US10884830B1 (en) | 2019-07-16 | 2021-01-05 | Advanced New Technologies Co., Ltd. | Method and apparatus for multithreaded data transmission in a tee system |
CN111114320A (en) * | 2019-12-27 | 2020-05-08 | 深圳市众鸿科技股份有限公司 | Vehicle-mounted intelligent cabin sharing display method and system |
CN111538585B (en) * | 2019-12-31 | 2022-03-01 | 明度智云(浙江)科技有限公司 | Js-based server process scheduling method, system and device |
CN111538585A (en) * | 2019-12-31 | 2020-08-14 | 浙江明度智控科技有限公司 | Js-based server process scheduling method, system and device |
CN111324461A (en) * | 2020-02-20 | 2020-06-23 | 西安芯瞳半导体技术有限公司 | Memory allocation method and device, computer equipment and storage medium |
CN111324461B (en) * | 2020-02-20 | 2023-09-01 | 西安芯瞳半导体技术有限公司 | Memory allocation method, memory allocation device, computer equipment and storage medium |
CN111796931A (en) * | 2020-06-09 | 2020-10-20 | 阿里巴巴集团控股有限公司 | Information processing method, device, computing equipment and medium |
CN111796931B (en) * | 2020-06-09 | 2024-03-29 | 阿里巴巴集团控股有限公司 | Information processing method, device, computing equipment and medium |
CN112181679A (en) * | 2020-09-13 | 2021-01-05 | 中国运载火箭技术研究院 | Rocket data processing method and device, computer storage medium and electronic equipment |
CN112181679B (en) * | 2020-09-13 | 2024-05-10 | 中国运载火箭技术研究院 | Rocket data processing method and device, computer storage medium and electronic equipment |
CN112187887A (en) * | 2020-09-14 | 2021-01-05 | 北京三快在线科技有限公司 | Webpage real-time communication method and device for multiple pages and electronic equipment |
CN112597162A (en) * | 2020-12-25 | 2021-04-02 | 平安银行股份有限公司 | Data set acquisition method, system, device and storage medium |
CN112597162B (en) * | 2020-12-25 | 2023-08-08 | 平安银行股份有限公司 | Data set acquisition method, system, equipment and storage medium |
CN112822193A (en) * | 2021-01-05 | 2021-05-18 | 网易(杭州)网络有限公司 | Application communication method, device, equipment and storage medium |
CN117077115A (en) * | 2023-10-13 | 2023-11-17 | 沐曦集成电路(上海)有限公司 | Cross-language multi-process interaction method, electronic equipment and medium in chip verification stage |
CN117077115B (en) * | 2023-10-13 | 2023-12-15 | 沐曦集成电路(上海)有限公司 | Cross-language multi-process interaction method, electronic equipment and medium in chip verification stage |
Also Published As
Publication number | Publication date |
---|---|
CN108062252B (en) | 2022-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108062252A (en) | A kind of information interacting method, method for managing object and device and system | |
Truyen et al. | Dynamic and selective combination of extensions in component-based applications | |
US8327374B1 (en) | Framework for executing multiple threads and sharing resources in a multithreaded computer programming environment | |
Honkola et al. | Smart-M3 information sharing platform | |
CN103106058B (en) | A kind of double-screen display method and intelligent display terminal based on android system | |
Vrijders et al. | Prototyping the recursive internet architecture: the IRATI project approach | |
US7849451B2 (en) | Dynamic delegation chain for runtime adaptation of a code unit to an environment | |
CN108958796A (en) | service request processing method and device, service request processing system | |
CN109933443A (en) | Inter-process communication methods, device, computer equipment and readable storage medium storing program for executing | |
CN109299587A (en) | Algorithm protection method, device, equipment and storage medium based on go language | |
CN113067900B (en) | Intelligent contract deployment method and device | |
Parlavantzas et al. | Towards a reflective component based middleware architecture | |
JP5422103B2 (en) | Method and apparatus for transferring data between separated execution contexts | |
CN102819452A (en) | Middleware device based on android system and method thereof | |
CN108399331A (en) | Application process trial method and system | |
CN107809332A (en) | Compound interface configures and compound interface call method, device | |
CN108733457A (en) | The implementation method and device of distributed transaction | |
Andersson et al. | Uml and systemc–a comparison and mapping rules for automatic code generation | |
Arbab et al. | A coordination language for mobile components | |
US20050125486A1 (en) | Decentralized operating system | |
US9058225B2 (en) | Secure and reliable mechanism to provide a single object instance in a clustered system | |
CN112162793B (en) | Method, storage medium, electronic device and system for separating structured view services | |
Molesini et al. | Environment in agent-oriented software engineering methodologies | |
CN114978686A (en) | Digital asset chaining method and device | |
CN110018890A (en) | A kind of exchange method of cross-thread, electronic equipment and readable storage medium storing program for executing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20201222 Address after: Room 603, 6 / F, Roche Plaza, 788 Cheung Sha Wan Road, Kowloon, China Applicant after: Zebra smart travel network (Hong Kong) Limited Address before: Cayman Islands Grand Cayman capital building, a four storey No. 847 mailbox Applicant before: Alibaba Group Holding Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |