CN101248405B - Multithreading with concurrency domains - Google Patents

Multithreading with concurrency domains Download PDF

Info

Publication number
CN101248405B
CN101248405B CN2006800146187A CN200680014618A CN101248405B CN 101248405 B CN101248405 B CN 101248405B CN 2006800146187 A CN2006800146187 A CN 2006800146187A CN 200680014618 A CN200680014618 A CN 200680014618A CN 101248405 B CN101248405 B CN 101248405B
Authority
CN
China
Prior art keywords
job
software application
concurrent
concurrent domain
application components
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.)
Expired - Fee Related
Application number
CN2006800146187A
Other languages
Chinese (zh)
Other versions
CN101248405A (en
Inventor
A·F·阿玛德
B·什亚姆桑达
B·M·奥兰尼科
C·A·西泽伯斯基
S·克莱安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Microsoft Technology Licensing LLC
Original Assignee
Microsoft Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US11/360,454 external-priority patent/US7581225B2/en
Application filed by Microsoft Corp filed Critical Microsoft Corp
Publication of CN101248405A publication Critical patent/CN101248405A/en
Application granted granted Critical
Publication of CN101248405B publication Critical patent/CN101248405B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

Methods, systems and computer products are provided for partitioning software application components into separate domains called concurrency domains. Computationally expensive, slow or long-running methods may be deployed into such domains, thus keeping the associated application more responsive to the end user. According to one aspect of the invention, a given concurrency domain is a partition of runtime objects for providing synchronization and thread isolation within the partition and for providing concurrency with other such partitions in a data-driven dynamically composed and reconfigured application.

Description

Use the multithreading of concurrent domain
Background technology
Along with the arrival of computer age, computing machine and software users more and more are accustomed to user friendly software application and are helped them to write, calculate, organize, prepare PowerPoint, send and receive e-mail, make music etc.For example, the hyundai electronics word-processing application allows the user to prepare various useful documents.Modern spreadsheet applications allows user's input, controls and organize data.Modern electronic slide presentation applications allows the user to create the various slide presentation that comprise text, picture, data or other useful object.
Many these application programs are operated according to component framework, and continuous operation of many application components and/or concurrent running are carried out each method of given overall application method in component framework.Usually, concurrent assembly method needs the multithreading of the whole bag of tricks.That is, support the application program of concurrent operations to use a plurality of method threads.Basic demand to this application program is that its synchronous a plurality of threads are so that the corresponding to ability of sharing between thread of any data.Difficult point in the software is reentry (reentrancy).Usually the problem of being introduced by method for synchronous is uncertain the reentry.Usually, reentry to make nesting allocation and therefore to finish and take place when entering same target for the second time before calling for the first time at thread.For example, if thread is being carried out the calling of the first task of first object, and as the part of this execution, call the task of second object, then this thread enters second object to before the calling and therefrom return of first object finishing.If the part that the task of second object is carried out comprises second task of calling first object, then this thread is finished the original call of first object and is being reentried first object before therefrom returning.
The multithreading synchronous and the application program method of application component is a challenge.For example, be difficult to coordinate the execution of each thread, when especially the instruction in two threads need be used same data or resource.Instruction on first thread may be changed the data that the instruction on second thread needs.If these data were changed before the instruction on second thread is carried out it, will in carrying out, program lead to errors.For the conventional application program that needs component synchronization and multithreading, used various existing threading models, comprised Java-style synchronized methods and statement, CLR (CLR), synchronous context, inner room threading and rent threading.Use this model need comprise in application programming that complex logic suitably handles a plurality of method threads.Use these models by conventional application program, must be with in the concurrent specific part that is designed into application program and must just test it at the correctness of deadlock and race condition.
Even if these existing models can be worked with the dynamic combined application framework that application program wherein is made up of a plurality of assemblies together, also cooperating well, wherein above-mentioned a plurality of assemblies are based on the data that other associated component by these assemblies or this application program receives and are dynamically generated or configuration again.This has problem very much, because this existing method is divided into multi-threaded system in a plurality of zones of this application program by force.For the application program of this dynamic generation and configuration again, be necessary application component is written as and do not have the complex thread processing logic that is associated with existing threading model.
The present invention makes at these and other consideration just.
Summary of the invention
Summary of the invention is introduced the notion that further describes in the following detailed description in simplified form and is selected.Summary of the invention is not intended to identify the key feature and the essential characteristic of institute's claimed subject matter, is not intended to be used to help to determine the scope of institute's claimed subject matter yet.
Embodiments of the present invention solve above and other problem by application component being divided in each the discrete territory that is called as concurrent domain.Can be deployed in these territories calculating method upward expensive, slow or long operational time, thereby keep affiliate application and terminal user's response.According to one aspect of the invention, given concurrent domain is a subregion of when operation object, is used for providing in this subregion synchronously and thread is separated and concurrent with the dynamic combined of data-driven and other these subregions of application program of disposing again be provided.
According to aspects of the present invention, in when operation, given data-driven dynamic combined and again configuring application program comprise one with a plurality of concurrent domains.First concurrent domain is main concurrent domain.Main concurrent domain comprises the user's interface unit of application program and management of user's interface establishment during application program launching.The additional concurrent domain that comprises in this application program is auxilliary concurrent domain.Auxilliary concurrent domain is by creating and operation as another concurrent domain of his father's concurrent domain.Concurrent domain can need the concurrent any time to use in given application program, and wherein each concurrent domain is carried out the task of primary application program and issued its result to another concurrent domain as required.
According to a particular aspect of the invention, provide a kind of method of operating, system and computer product that is used for the synchronizing software application component.According to this aspect, first concurrent domain is provided, it comprises the single inter-process thread that can be operable at least one single-threaded object of carrying out this software application.First border object that is associated with first concurrent domain is provided, and is used for making its software application object outside first concurrent domain to receive first job that is directed to single-threaded object.First border object also is used for this first job is charged to work item queue.First thread scheduler that is included in the concurrent domain is provided, and can be used for making it from work item queue, to retrieve first job of having charged to and first job that will charge to passing to single-threaded object and handle for single-threaded object.Single-threaded object is used to handle first job charged to and the result is returned to external object via first border object.
By reading the general introduction of following detailed description and associated drawings, characterizing these and other feature of the present invention will become apparent.Should be appreciated that more than general introduction and following detailed description all only are exemplary, but not to the restriction of the present invention of prescription.
Description of drawings
Fig. 1 illustrates wherein can realize suitable computing environment of the present invention.
Fig. 2 illustrates the example system that is configured according to an embodiment of the present invention in order to a plurality of objects of concurrent execution.
Fig. 3 illustrates another example system that is configured according to an embodiment of the present invention in order to a plurality of objects of concurrent execution.
Fig. 4 has described the asynchronous communication between internal single-threaded object and external object.
Fig. 5 illustrates the example path of execution when concurrent domain and database interface.
Fig. 6 illustrates the wherein operational flowchart of first concurrent domain and database interface.
Fig. 7 illustrates the example path of execution when first concurrent domain and the second concurrent domain interface.
Fig. 8 illustrates the wherein operational flowchart of first concurrent domain and the second concurrent domain interface.
Embodiment
In the following detailed description, to the part of book as an illustration and specific implementations is described by way of example or embodiment and the accompanying drawing that illustrates carries out reference.In some accompanying drawings, similar Reference numeral is represented similar assembly, entity and configuration.Other embodiment can be made up, can use to these embodiments and constructive variations can be under the situation that does not deviate from the spirit and scope of the present invention, carried out.Therefore, below describe in detail and should not treat, and scope of the present invention is by appended claims and equivalents definition thereof with the restriction theory.
Fig. 1 illustrates the suitable computing environment that is used to realize concurrent domain.Though not necessarily, embodiments of the present invention will be described in the general context of the computer executable instructions of being carried out by personal computer.Usually, programming operation is carried out particular task or is realized particular abstract data types.
System 100 comprises processing unit 102, system storage 104 and will comprise that the various system components of system storage 104 are coupled to the system bus 106 of processing unit 102.System bus 106 can be to comprise in the some types of bus structures of memory bus, peripheral bus and local bus of using in the various bus architectures any any.System storage comprises ROM (read-only memory) (ROM) 108 and random-access memory (ram) 110.The basic input/output 112 (BIOS) that comprises the basic routine of transinformation between the element of help in computer system 100 is stored among the ROM108.
Computer system 100 also comprises hard disk drive 112 from disk read-write, from the disc driver 114 of moveable magnetic disc 116 read-writes with from CD drive 118 such as removable CD 119 read-writes of CD ROM, DVD or other optical medium.Hard disk drive 112, disc driver 114 and CD drive 118 can be connected to system bus 106 by hard disk drive interface 120, disk drive interface 122 and CD drive interface 124 respectively.Driver and associated computer-readable media thereof provide the non-volatile memories of computer-readable instruction, data structure, program and other data for computer system 100.
Though example context as herein described is used hard disk 112, moveable magnetic disc 116 and removable CD 119, the computer-readable medium that can store other type of data also can be used for this example system 100.The example that can be used for these other type computer computer-readable recording mediums of exemplary operations environment comprises tape cassete, flash card, digital video disc, Bernoulli magnetic tape cassette, random-access memory (ram) and ROM (read-only memory) (ROM).Many program modules can be stored on hard disk 112, disk 116, CD 119, ROM 108 or the RAM 110, and these program modules comprise storage system 126, application program 128, other program module 130 and routine data 132.
The user can by such as the input equipment of keyboard 134, mouse 136 or other pointing device to computer system 100 input commands or information.The example of other input equipment comprises toolbar, menu, touch-screen, microphone, operating rod, game mat, pen, satellite dish and scanner.These and other input equipment is connected to processing unit 102 by the serial port interface 140 that is coupled with system bus 106 usually.Yet these input equipments also can connect by other interface such as parallel port, game port or USB (universal serial bus) (USB).The display device of LCD display 142 or other type also can be connected to system bus 106 via the interface such as video adapter 144.Except display 142, computer system can comprise other peripheral output device (not shown) usually, such as loudspeaker and printer.
Computer system 100 can be connected with the logic of one or more remote computers such as remote computer 146 and operate in networked environment using.Remote computer 146 can be computer system, server, router, network PC, peer device or other common network node, and generally includes above a plurality of or whole in the element that computer system 100 describes of being relevant to.Network connects and comprises Local Area Network 148 and wide area network (WAN) 150.This networked environment is very common in office, enterprises computer network, Intranet and the Internet.
When using in the lan network environment, computer system 100 can be connected to LAN (Local Area Network) 148 by network interface or adapter 152.When using in the WAN network environment, computer system 100 generally includes and be used for the modulator-demodular unit 154 or other device that establish a communications link on the wide area network 150 such as the Internet.Modulator-demodular unit 154 that can be internal or external is connected to system bus 106 via serial port interface 140.In networked environment, the program module that is relevant to the description of computer system 100 or its part can be stored in the remote memory storage device.Should be appreciated that, shown in network to connect be example, and can use other device of between computing machine, setting up communication linkage.
Embodiment described herein can be embodied as the logical operation in the computing system.Logical operation can be embodied as computer realization sequence of steps or the program module of (1) on computer system, moving; And (2) interconnect logic or hardware module of in computing system, moving.This realization is the selection of depending on the performance requirement of concrete computing system.Therefore, the logical operation of formation each embodiment described herein is meant operation, step or task.These operations, step and task can realize in software, firmware, special digital logic and combination in any thereof and not deviate from the spirit and scope of the present invention of setting forth in the appended claims.This software, firmware or similar sequence of computer instructions can be encoded and be stored on the computer-readable recording medium, and also can be coded in the carrier signal of transmitting between the computing equipment.
As above briefly describe, embodiment of the present invention relates to each assembly with software application and is divided into and is used in the discrete territory providing in the assembly subregion synchronously and method, system and computer product that thread is isolated and be used for providing improved concurrent operations between the assembly subregion.Fig. 2 illustrates the example system that is configured according to an embodiment of the present invention in order to a plurality of objects of concurrent execution.Example system 200 comprises concurrent domain 201, this concurrent domain be all on single thread 202, carry out and not with the directly set (or subregion) of (for example or asynchronous) one or more single-threaded object 203 of communicating by letter of external object 210.Internal thread 202 is carried out object 203 according to the logic of being utilized by concurrent domain 201.Internal thread 202 is the single-threaded object 203 in the execution concurrence territory 201 only.Internal thread 202 is not carried out any external object 210.
According to an embodiment, same thread need be always as internal thread 202 in the whole life cycle of concurrent domain 201.On the contrary, when not having object to carry out on internal thread 202, the thread that serves as internal thread 202 can return the thread pool (not shown).In case need thread once more, new thread can be taken out from thread pool to be used as internal thread 202.According to another embodiment, one of single-threaded 203 have thread affinity, represent that this single-threaded object 203 need carry out on same thread.In the present embodiment, same thread is used as internal thread 202 in the whole life cycle of concurrent domain 201.According to an embodiment, also can from thread pool, locate and incite somebody to action in this article secondary thread 204 in greater detail.
Still with reference to Fig. 2, system 200 also comprises at least one secondary thread 204 and at least one external object 210.The embodiment of external object 210 is included in any object of carrying out on one or more secondary thread 204.Secondary thread 204 is included in any thread of carrying out in the affiliate application except that internal thread 202.As mentioned above, example concurrent domain 201 as shown in Figure 2 comprises internal thread 202 and a plurality of single-threaded object 203.Only use internal thread 202 to carry out these single-threaded object 203.
Object 203 in the concurrent domain 201 is separated from secondary thread 204 and external object 210 in the program.Any single-threaded object 203 that secondary thread 204 does not comprise in the execution concurrence territory 201.Each external object 210 is configured to carry out on secondary thread 204 one or more.Single-threaded object 203 asynchronous communications in external object 210 and the concurrent domain 201.Communication is included in Data transmission between the object or by another object the method for an object (for example, or task) is called.
The asynchronous communication that strides across concurrent domain 201 borders realizes by using border object 207.Each concurrent domain 201 is all related with one or more border object 207.These border objects 207 can be regarded as surrounding the barrier film (membrane) or the gated wall (gated wall) of concurrent domain 201.The example of border object 207 is included between the concurrent domain 201 or realizes the data connector and the object of custom protocols between concurrent domain 201 and external object 210.
Single-threaded object 203 in the concurrent domain 201 is used one or more border objects 207 and external object 210 asynchronous communications.Single-threaded object 203 uses internal thread 202 to communicate by letter with border object 207.Border object 207 uses one or more secondary thread 204 to communicate by letter with external object 210 subsequently.The border of taking this border object 207 leap concurrent domains 201 is transmitted information and is called.According to another embodiment, a border object 207 was using secondary thread 204 to communicate by letter with another border object 207 before external object 210 transmission information.
Border object 207 is as the internal thread 202 of concurrent domain 201 and the interface between each secondary thread 204.According to an embodiment, border object 207 uses secondary thread 204 to receive importing communication into and this communication is filled into suitable internal object 203 from external object 210.Filter method will be described in this article in more detail.According to another embodiment, border object 207 use internal thread 202 receive spreading out of communication and using secondary thread 204 with the extremely suitable external object 210 of this communications from internal object 203.According to an embodiment, border object can call external object on internal thread, but so the border object of operation is restricted.That is, allow border object to call external object and must not can cause thus that postpone or deadlock indefinite duration.Another restriction prevents that external object from quoting internal object, thereby prevents that the concurrent domain under the externally object control from directly reentrying.
The thread of carrying out thereon when first object enters second object synchronous communication takes place when carrying out second object method.External object 210 is not carried out synchronous communication with concurrent domain 201 interior single-threaded object 203.Therefore, the single-threaded object 203 in the concurrent domain 201 is not directly called or entered to the secondary thread of execution external object 210.
Fig. 3 illustrates another example system 300 of concurrent domain wherein 301 and external object 310 interfaces.An example of asynchronous communication externally illustrates between object 310 and the internal object 303.Concurrent domain 301 comprises internal thread 302, is configured to the single-threaded object 303 and the border object 307 that is used for communicating by letter with external object 310 of execution on internal thread 302.Another embodiment of native system 300 comprises a plurality of border objects 307 and a plurality of single-threaded object 303.
With reference to another embodiment, external object 310 comprises be configured to the multithreading object 305 carried out on two or more secondary thread.A part of 305A of multithreading object 305 is shown in that a secondary thread 304A go up to carry out and another part 305B of multithreading object 305 is shown in another secondary thread 304B and goes up and carry out.According to another embodiment, the single-threaded object (not shown) that external object 310 comprises a plurality of multithreading objects 305 or is configured to carry out on a secondary thread 304.
Concurrent domain 301 maintenance work formations 308 in the system 300.Work queue 308 is multielement data structures of charging to (for example, inserting) task (for example method, Data Update and other executing method of inside, single-threaded object 303 calls) thereon or therefrom removing task.According to an embodiment, only can task be removed from work queue 308 to charge to identical order with task; Promptly follow the restriction of first in first out.According to another embodiment, can be to the Task Distribution right of priority of charging to formation, and remove each task according to its right of priority.
Import communication into and charge to work queue 308 by border object 307.These communications of having charged to form jobs 311, and these jobs are to be used to carry out inside, single-threaded object 303 or the request (for example, calling) of the task of the border object 307 that is associated with concurrent domain 301.The request that forms job 311 can be communicated to this border object 307 by external object 310 or by another border object 307.For example, in Fig. 3, the multithreading object 305 request border objects 307 of external object 310 are executed the task, shown in arrow 320.Border object 307 will comprise that the job 311 of this task is logged into the end of 308 work queues, shown in arrow 325.According to another embodiment, a plurality of border objects 307 are associated with concurrent domain 301, and one or more in these border objects 307 can charge to job 311 in work queue 308.According to another embodiment, inner, single-threaded object 303 request border objects 307 are charged to job 311 task executions is deferred to the later moment in work queue 308.
According to an embodiment, in order to guarantee that when preparing to charge to new task in work queue 308 resource is certain, border object 307 is checked work queue 308 and is determined whether that the job 311 of any queuing comprises inter-related task.If there is inter-related task, then border object 307 is optionally packed new task as subtask and the inter-related task of before having joined the team, rather than new task is charged to as a whole new job 311.
Still with reference to Fig. 3, according to an embodiment, concurrent domain 301 comprises the scheduler 309 that is used to handle to single-threaded object 303 despatching work projects 311 from work queue 308.Scheduler 309 uses internal thread 302 to remove job 311 from work queue 308 and dispatches each task 311 for carrying out in internal thread 302.Scheduler 309 calls being included in the job 311 of task.For example in Fig. 3, scheduler 309 is despatching work project 311 from work queue 308, shown in arrow 330.Then, job is carried out on internal thread 302, shown in arrow 335.
According to an embodiment, charge to job 311 to work queue 308 and can't force scheduler 309 to make action.On the contrary, the execution of job 311 is delayed to the time point by the top layer circle logic appointment of concurrent domain 301.In case job is credited to work queue 308, then internal thread 302 is carried out institute's tasks requested in concurrent domain 301 next suitable circulation of being determined by scheduler 309.Therefore, when external object 310 and uncertain job 311 are removed, and therefore when the task of also uncertain inside, single-threaded object 303 is called and carries out.When external object 310 same uncertain border objects 307 execute the task on the internal thread 302 of concurrent domain 301.
In case task is scheduled and finishes, then spread out of the result and be delivered to border object 307 as callback.Border object 307 subsequently with this callback communications to external object 310, be exactly that this external object 310 is charged to the job 311 of calling the task of realizing this result at first.The example of callback comprises mark that data, indication task finish, method callback etc.
Fig. 4 has described the asynchronous communication between inside, single-threaded object and the external object.According to the embodiment of the present invention, show the communication chain 400 that takes place in the asynchronous communication process between the object 401 and internal single-threaded object 409 externally.External object 401 at first communicates by letter 402 with border object 403.This communication 402 have usually call or task that request call is related with the concurrent domain (not shown) in one or more forms.Though institute's tasks requested is actually the task of single-threaded object 409,401 of external object are related with concurrent domain or border object 403 with this task.
Then, border object 403 communicates by letter 404 with work queue 405.This communication 404 generally includes charges to work queue 405 with the job (not shown).Work queue 405 communicates by letter 406 with scheduler 407 subsequently.This communication 406 generally includes each job of charging in the scheduler 407 continuous despatching work formations 405.At last, scheduler 407 communicates by letter 408 with the invoked internal single-threaded object 409 of its task.This communication 408 generally includes the task of calling internal single-threaded object 409.In another embodiment, external object 401 is communicated by letter with another border object (not shown) of concurrent domain.
As the above puzzlement of avoiding the reentry problem described in background technology one joint with reference to the described asynchronous communication protection internal single-threaded object of striding the concurrent domain border of Fig. 2-4.Such as will be appreciated, when the object under the top layer logic control of concurrent domain (for example, internal single-threaded object or border object) direct internal thread is reentried same another object under this top layer logic control, can cause the reentry of internal control.When not being object (for example, external object) direct internal thread under the logic control of concurrent domain item layer when reentrying object under this top layer logic control, can cause external control to reentry.In reentrying own or same concurrent domain, internal object during another object, can cause inside to cause reentrying.When the time effects that caused by external object is reentried, thereby when removing control by the logic from be included in the concurrent domain internal object jointly of reentrying effectively, can cause the outside to cause reentrying.The result is exactly uncertain the reentry.
Again with reference to Fig. 3, the asynchronous communication protection internal single-threaded object 303 that only allows to stride concurrent domain 301 is avoided the external control reentry.For example, if the execution of internal single-threaded object 303 comprises the task of calling external object 310, then internal thread 302 will enter will calling in the lump of the border object 307 that is associated with concurrent domain 301 task that the task of external object 310 is responsible for will be carried out in request.Internal thread 302 can turn back to the task of carrying out internal single-threaded object 303 subsequently or turn back to the modulated degree job 311 of execution from work queue 308.It because can not leaving concurrent domain 301, internal thread 302 does not enter external object 310, so can not fall under the control of external object 310.
In addition, if, then do not allow internal thread 302 reentry concurrent domains 301 if the task and this task executions that allow internal thread 302 to carry out external object 310 comprise another task of calling internal single-threaded object 303.On the contrary, internal thread 302 border object 307 that can enter concurrent domain 301 calls the task of being responsible for charging to job 311.Perhaps, as mentioned above, under some restriction, border object can call external object and come calling task on internal thread.After calling this task, internal thread 302 turn back to the task of carrying out external object 310 and turn back to subsequently carry out internal single-threaded object 303 first, ancestral task.In other words, internal thread 302 can not carried out by calling up to first task of 310 pairs second tasks of external object and finish and up to finishing aforesaid operations by scheduler 309 guiding of concurrent domain 301.
Referring now to Fig. 5 and 6,, come embodiments of the present invention are described at exemplary external object with data source.Fig. 5 illustrates the system 500 that comprises concurrent domain 501 and data source 512, and Fig. 6 shows the operational flowchart 600 of the interface between the secondary thread 504 of the internal thread 502 of describing concurrent domain 501 and data source 512.In one embodiment, secondary thread 504 comprises a plurality of secondary thread 504.Concurrent domain 501 comprises single-threaded object 503 and scheduler 509, and is associated with border object 507.Concurrent domain 501 is safeguarded the work queue 508 of the hang-up task carried out of indicating on the internal thread 502 of concurrent domain 501.In one embodiment, data source 512 is databases.In another embodiment, data source 512 is networks.
The execution route of internal thread 502 and secondary thread 504 is shown in two accompanying drawings.In Fig. 5, dotted arrow has been described the task of carrying out and has been carried out on internal thread 502, and the task that solid arrow has then been described to take place on one or more in secondary thread 504 is carried out.The Reference numeral that refers to dotted line and solid arrow is corresponding to operation or the task carried out at Fig. 6, and wherein Fig. 6 illustrates each task of arranging along the thread of carrying out thereon.
Still with reference to Fig. 5 and 6, this method begins at beginning frame 601, and proceeds to operation 602, and wherein single-threaded object 503 request border objects 507 call being associated with data source 512 of task.This request is carried out on the internal thread 502 of concurrent domain.In operation 603, scheduler 509 is according to work queue 508 orders and dispatch each job 511.According to an embodiment, charge to internal thread 502 each job 511 of scheduling that use in order of work queue 508 with job 511.For example, suppose not have new job 511 to be added to therebetween, then scheduler 509 is by job 1 beginning sequence and by job 7 end sequence.Can after job 7, add any new job 511.According to another embodiment, according to the priority valve despatching work project 511 of distributing.
Method 602 is also led to and operation 602 methods that are performed simultaneously 611.In method 611, border object 507 calls being associated with data source 512 of task.This is invoked on one of secondary thread 504 and carries out.Afterwards, this method proceeds to operation 612, wherein carries out the task of data source 512 in secondary thread 504 on one or more.Next, operation 613 comprises that database 512 sends back border object 507 with execution result as callback.This result's one or more the going up that is transmitted in secondary thread 504 taken place.Then, in operation 614, border object 507 is charged to work queue 508 with callback as job 511.This one or more going up that is logged in secondary thread 504 is carried out.
From operating 614, this method proceeds to operation 604.Operation 603 also can be led to operation 604.When the scheduler 509 of the job 511 in the order execution work formation 508 in operation 603 arrived the callback job 511 of being added by border object 507 in operation 614, operation 604 took place.Scheduler 509 uses internal thread 502 to arrive callback.In case callback is scheduled, then scheduler 509 continues each job 511 in operation 605 sequential scheduling work queues 508.
Referring now to Fig. 7 and 8, embodiments of the present invention are described at the exemplary external object that comprises second concurrent domain.Fig. 7 shows the system 700 that comprises first concurrent domain 701 and second concurrent domain 721 respectively, and Fig. 8 shows the operational flowchart 800 of first concurrent domain 701 and second concurrent domain, 721 interfaces therein.Each concurrent domain 701,721 comprises internal thread 702,722, single-threaded object 703,723 and scheduler 709,729 respectively.Each concurrent domain 701,721 is associated with border object 707,727 respectively and safeguards the work queue 708,728 of the hang-up job 711,731 carried out of indicating respectively on internal thread 702,722.In Fig. 7, first group of dotted arrow is illustrated in taking place on the internal thread 702 of task and carries out, one group of solid arrow is illustrated in the one or more of secondary thread 704 and goes up the tasks execution that takes place, and second group of dotted arrow is illustrated in the task execution that takes place on second internal thread 722.These dotted lines and solid arrow show the execution that relates to the various operations of communicating by letter between first concurrent domain 701 and second concurrent domain 721.The Reference numeral that refers to these arrows is corresponding with operation or the task carried out at Fig. 8.
Still with reference to Fig. 7 and 8, this method is in 801 beginnings of beginning frame and proceed to operation 802 and 822.Operation 822 comprises uses internal thread 722 to come the scheduler 729 of second concurrent domain 721 of each job 731 in the sequential scheduling work queue 728.Operation 802 is carried out simultaneously with operation 822.At the single-threaded object 703 request border objects 707 of operation 802, the first concurrent domains 701 from one of the object of second concurrent domain 721 calling task.In one embodiment, institute's tasks requested is the task of one of the single-threaded object 723 of second concurrent domain 721.In another embodiment, institute's tasks requested is the task of one of border object 727 of being associated with second concurrent domain 721.
From operating 802, this method proceeds to two operations 803 and 812.Each job 711 in the scheduler 709 sequential scheduling work queues 708 of operation 803, the first concurrent domains 701.Border object 707 in operation 812, the first concurrent domains 701 uses the one or more of secondary thread 704 to communicate by letter with the border object 727 of second concurrent domain 721.Communication comprises the request of degree of exchanging task.Then, at operation 813, the second border objects 727 institute's tasks requested is charged to work queue 728 as job 731.This charges to one or more execution of use secondary thread 704.
Operation 823 is all led in operation 813 and operation 822.In operation 823, scheduler 729 arrives and dispatches the job 731 that comprises institute's tasks requested.This scheduling is carried out on the internal thread 722 of second concurrent domain 721.In operation 824, carry out this task subsequently as callback to single-threaded object 703 in first concurrent domain 701.In this, this method separate once more and proceed to the operation 825 and 814.In operation 825, each job 731 that scheduler 729 continues in the sequential scheduling work queue 728.
Operation 814 takes place simultaneously with operation 825.In operation 814, the border object 727 of second concurrent domain 721 uses one or more secondary thread 704 to ask the border object 707 of first concurrent domain 701 that callback is charged to work queue 708 as job 711.Afterwards, in operation 815, border object 707 is charged to work queue 708 with this callback.This one or more going up that is logged in secondary thread 704 is carried out.
When the scheduler 709 of first concurrent domain 701 arrives the callback that is logged in the work queue 708, operate 804.Scheduler 709 uses the internal thread 702 of first concurrent domain 701 to dispatch this callback.This callback is carried out in operation 805.Afterwards, this method proceeds to operation 806, and scheduler 709 continuation are therein dispatched each job 711 in an orderly manner according to the order of work queue 708.This method finishes 806.
Another example (not shown) of system comprise interface each other and with three or above concurrent domain of other external object interface.This system is basically according to coming work with identical operations described herein.Each concurrent domain in this system comprises internal thread, one or more single-threaded object and scheduler.But each concurrent domain can with at least one border object to related and maintenance work formation.All communications of striding the concurrent domain border all are asynchronous (for example, border object, work queue and the scheduler by response filter).
Aforesaid each embodiment only provides in illustrational mode, and should not be construed restriction the present invention.Those skilled in the art are easy to recognize and can make various changes and variation to the present invention, and example embodiment that does not illustrate and describe according to this paper and application and do not deviate from true spirit of the present invention and the scope of in appended claims, setting forth.

Claims (17)

1. the method for operating of a synchronizing software application component comprises:
Receiving first job handles for first software application components;
Determine whether to have in the work item queue any job of before having charged to comprise and the relevant task of described first job;
There is the job of before having charged to comprise and the relevant task of described first job in response to determining in the work item queue, with this job of before the having charged to packing in described first job and the described work item queue;
Comprise and the relevant task of described first job without any the job of before having charged in the work item queue in response to determining, described first job is charged to described work item queue;
Determine whether described first software application components has been finished passing to the processing of described first software application components for any previous job of handling;
If described first software application components has been finished passing to the processing of described first software application components for any previous job of handling, then retrieval has been logged into described first job of described work item queue; And
First job that retrieves is passed to described first software application components for processing.
2. the method for claim 1, it is characterized in that, before reception first job is handled for first software application components, with other assembly of described software application described first software application components of instantiation in concurrent domain dividually, described concurrent domain comprises the single inter-process thread that can be used for carrying out described first software application components.
3. method as claimed in claim 2 is characterized in that,
Described reception first job is handled for first software application components and comprised: in described first job of the border object place reception that is associated with described concurrent domain from the object of the described software application of described concurrent domain outside, described first job is directed to described first software application components;
Describedly described first job charged to described work item queue comprise: make described border object with described first job charge to described work item queue for described first software application components with aftertreatment.
4. method as claimed in claim 3, it is characterized in that determine whether described first software application components has been finished to comprise for the processing of any previous job of handling passing to described first software application components: whether the dispatcher object of determining to be arranged in the described concurrent domain is notified: the result from any previous job that is delivered to described first software application components is passed to described border object from described first software application components.
5. method as claimed in claim 4, it is characterized in that, described first job that retrieval has been logged into described work item queue comprises: in response to the notice that has been passed to described border object from the result of any previous job that is delivered to described first software application components from described first software application components, make described dispatcher object retrieval charge to described first job of described work item queue.
6. method as claimed in claim 5, it is characterized in that, first job that retrieves is passed to described first software application components to be comprised for processing: the notice in response to be passed to described border object from described first software application components from the result of any previous job that is delivered to described first software application components makes described dispatcher object that described first job that retrieves is passed to described first software application components for processing.
7. method as claimed in claim 6, it is characterized in that, also comprise making described dispatcher object detain second job of having charged to that is directed to described first software application components, return the result of described first job that retrieves up to described first software application components by described border object to described external object from described first software application components.
8. method as claimed in claim 7, it is characterized in that, making described dispatcher object detain second job of having charged to that is directed to described first software application components from described first software application components comprises: stop described second job of having charged to of the described first software application components request, make described first software application components only determine that at described dispatcher object described first software application components just can receive described second job of having charged to when being ready to handle described second job of having charged to.
9. method as claimed in claim 7, it is characterized in that, comprise in described first job of the border object place reception that is associated with described concurrent domain: receive described first job at described border object place from auxilliary concurrent domain from the object of the described software application of described concurrent domain outside, described auxilliary concurrent domain comprises the single internal thread that is configured to be included in order to execution second software application components in the described auxilliary concurrent domain, and described auxilliary concurrent domain is associated with the auxilliary concurrent domain border object that is used for via described border object receives from the result of described first software application components.
10. the method for concurrent fill order's thread and multithreading object, described method comprises:
Reception comprises the software application of a plurality of component softwares that are used for the concurrent processing data;
Each of described component software that will be used for the concurrent processing data is divided into discrete concurrent domain;
The discrete concurrent domain of border object and each is associated to be used for receiving any data call of each component software object that the described discrete concurrent domain of guiding comprises, and wherein said border object is used for:
Receive first job from the software application object of the first concurrent domain outside,
Determine with work item queue that described border object is associated in whether have any job of before having charged to comprise and the relevant task of described first job,
There is the job of before having charged to comprise relevant task in the work item queue in response to determining, with this job of before the having charged to packing in described first job and the described work item queue,
Comprise and the relevant task of described first job without any the job of before having charged in the work item queue in response to determining, described first job is charged to described work item queue; And
In each described discrete concurrent domain, be provided with dispatcher object be used for each independently the component software object finished to first forward direction described each independently after other data call that provides of component software object to described each independently the component software object data call is provided.
11. method as claimed in claim 10 is characterized in that, also comprises:
In first concurrent domain, use the single processing threads of the described first concurrent domain inside to carry out at least one single-threaded object in response to the data call that receives from described dispatcher object, described single processing threads need not directly the calling of any secondary thread of the described first concurrent domain outside and carries out; And
Use auxilliary processing threads to carry out at least one external object that is not included in described first concurrent domain, described auxilliary processing threads need not directly the calling of described single processing threads in described first concurrent domain and carries out.
12. method as claimed in claim 11 is characterized in that, also comprises:
Use the described border object related interface between the described single processing threads of the described first concurrent domain inside and described auxilliary processing threads with described first concurrent domain.
13. method as claimed in claim 12, it is characterized in that, described auxilliary processing threads comprises the second single processing threads of the second concurrent domain inside, the wherein said second single processing threads is configured to be included in single-threaded object in described second concurrent domain in order to execution, and described second concurrent domain has the related border object that is used for the described border object interfaces that is associated with described first concurrent domain.
14. method as claimed in claim 13 is characterized in that, job be stored with work queue that each border object is associated in, up to by the dispatcher object retrieval of association in order to till providing to given independently component software object.
15. method as claimed in claim 14, also be included in the described border object place that is associated with described first concurrent domain via receiving data call from described second concurrent domain, carry out for the given component software object that is included in described first concurrent domain with the related border object of described second concurrent domain.
16. method as claimed in claim 15 is characterized in that, also comprises leaving in the work queue related with described first concurrent domain from the described data call of described second concurrent domain.
17. method as claimed in claim 16, it is characterized in that, finished processing if be included in described given component software object in described first concurrent domain to the data call of any previous reception, just make the dispatcher object that is associated with described first concurrent domain from described work queue that described first concurrent domain is associated retrieval from the data call of described second concurrent domain, and the feasible dispatcher object related with described first concurrent domain will provide described data call from described second concurrent domain for processing from the described given component software object of described data call in being included in described first concurrent domain of described second concurrent domain.
CN2006800146187A 2005-04-29 2006-04-20 Multithreading with concurrency domains Expired - Fee Related CN101248405B (en)

Applications Claiming Priority (7)

Application Number Priority Date Filing Date Title
US67613705P 2005-04-29 2005-04-29
US60/676,137 2005-04-29
US70322005P 2005-07-28 2005-07-28
US60/703,220 2005-07-28
US11/360,454 2006-02-23
US11/360,454 US7581225B2 (en) 2005-04-29 2006-02-23 Multithreading with concurrency domains
PCT/US2006/015185 WO2006118826A2 (en) 2005-04-29 2006-04-20 Multithreading with concurrency domains

Publications (2)

Publication Number Publication Date
CN101248405A CN101248405A (en) 2008-08-20
CN101248405B true CN101248405B (en) 2010-09-15

Family

ID=39334892

Family Applications (4)

Application Number Title Priority Date Filing Date
CN200680014594.5A Expired - Fee Related CN101512503B (en) 2005-04-29 2006-04-20 Xml application framework
CN200680014637XA Expired - Fee Related CN101167052B (en) 2005-04-29 2006-04-20 Application framework phasing model
CN2006800146187A Expired - Fee Related CN101248405B (en) 2005-04-29 2006-04-20 Multithreading with concurrency domains
CN200680014092.2A Expired - Fee Related CN101542457B (en) 2005-04-29 2006-04-20 Transaction transforms

Family Applications Before (2)

Application Number Title Priority Date Filing Date
CN200680014594.5A Expired - Fee Related CN101512503B (en) 2005-04-29 2006-04-20 Xml application framework
CN200680014637XA Expired - Fee Related CN101167052B (en) 2005-04-29 2006-04-20 Application framework phasing model

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN200680014092.2A Expired - Fee Related CN101542457B (en) 2005-04-29 2006-04-20 Transaction transforms

Country Status (1)

Country Link
CN (4) CN101512503B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102455933B (en) * 2010-10-22 2014-01-15 深圳市科陆电子科技股份有限公司 Method for increasing multi-tasking efficiency through thread management
CN102831053B (en) * 2011-06-17 2015-05-13 阿里巴巴集团控股有限公司 Scheduling method and device for test execution
CN103793384B (en) * 2012-10-26 2017-09-19 上海宝信软件股份有限公司 A kind of general client and the method for service end data binding
US20150248203A1 (en) * 2014-03-03 2015-09-03 Microsoft Technology Licensing, Llc Portable business logic with branching and gating
CN104408120B (en) * 2014-11-26 2019-04-12 北京国双科技有限公司 The processing method and processing device of source code
KR102000266B1 (en) * 2016-01-15 2019-07-15 구글 엘엘씨 Identifiers across application instances
CN105843789A (en) * 2016-04-01 2016-08-10 乐视控股(北京)有限公司 Rich text monitoring method and device
WO2018039061A1 (en) * 2016-08-23 2018-03-01 Oracle International Corporation System and method for supporting fast hybrid reconfiguration in a high performance computing environment
US10708389B2 (en) * 2016-12-06 2020-07-07 Intelligrated Headquarters, Llc Phased deployment of scalable real time web applications for material handling system
CN107450725B (en) * 2017-07-31 2020-09-11 科大讯飞股份有限公司 Man-machine interaction application platform, method and storage medium
CN107402768B (en) * 2017-07-31 2020-06-30 四川长虹电器股份有限公司 Reusable and extensible Android application development method
CN110032718B (en) * 2019-04-12 2023-04-18 广州广燃设计有限公司 Table conversion method, system and storage medium
CN110347516B (en) * 2019-06-27 2023-03-24 河北科技大学 Fine-granularity read-write lock-oriented software automatic reconstruction method and device
CN110393918A (en) * 2019-07-26 2019-11-01 网易(杭州)网络有限公司 A kind of method and apparatus of game trigger production
CN110727703B (en) * 2019-09-23 2022-10-11 苏宁云计算有限公司 Method and device for automatically identifying comments in JSON codes
CN112817573B (en) * 2019-11-18 2024-03-01 北京沃东天骏信息技术有限公司 Method, apparatus, computer system, and medium for building a streaming computing application
CN111897529B (en) * 2020-06-08 2023-11-14 华人运通(江苏)技术有限公司 Front-end component conversion method, device, equipment and readable storage medium
CN114610725B (en) * 2022-05-11 2022-08-16 成都九洲电子信息系统股份有限公司 Computer equipment, application method thereof and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5659701A (en) * 1991-12-02 1997-08-19 International Business Machines Corporation Apparatus and method for distributed program stack
US6083276A (en) * 1998-06-11 2000-07-04 Corel, Inc. Creating and configuring component-based applications using a text-based descriptive attribute grammar
US6670969B1 (en) * 2000-06-29 2003-12-30 Curl Corporation Interface frames for threads
CN1588316A (en) * 2004-06-29 2005-03-02 北京大学 Property optimizing method for applying server

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5940828A (en) * 1997-11-18 1999-08-17 International Business Machines Corporation Locking contention resolution for shared resources
US20050091576A1 (en) * 2003-10-24 2005-04-28 Microsoft Corporation Programming interface for a computer platform
SG99941A1 (en) * 2000-08-30 2003-11-27 Ibm Transaction support on logical disks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5659701A (en) * 1991-12-02 1997-08-19 International Business Machines Corporation Apparatus and method for distributed program stack
US6083276A (en) * 1998-06-11 2000-07-04 Corel, Inc. Creating and configuring component-based applications using a text-based descriptive attribute grammar
US6670969B1 (en) * 2000-06-29 2003-12-30 Curl Corporation Interface frames for threads
CN1588316A (en) * 2004-06-29 2005-03-02 北京大学 Property optimizing method for applying server

Also Published As

Publication number Publication date
CN101248405A (en) 2008-08-20
CN101167052B (en) 2012-05-16
CN101512503B (en) 2013-03-27
CN101512503A (en) 2009-08-19
CN101542457B (en) 2015-11-25
CN101167052A (en) 2008-04-23
CN101542457A (en) 2009-09-23

Similar Documents

Publication Publication Date Title
CN101248405B (en) Multithreading with concurrency domains
CN100410872C (en) Enhanced operating time host computer support
Wolfe et al. Real-time CORBA
CN101097527B (en) Flowpath scheduling method and system of application progress
US7581225B2 (en) Multithreading with concurrency domains
CN100530123C (en) Method for optimising the logging and replay of multi-task applications in a mono-processor or multi-processor computer system
Fay-Wolfe et al. Real-time CORBA
CN100553214C (en) Mobile virtual environment system
WO2020186836A1 (en) Task scheduling
EP1506475A2 (en) Hybrid threads for multiplexing virtual machine
US20060020701A1 (en) Thread transfer between processors
WO2008003536A2 (en) Method, system and computer program for determining the processing order of a plurality of events
Goransson Efficient android threading: Asynchronous processing techniques for android applications
Zhao et al. Realizing fast, scalable and reliable scientific computations in grid environments
Miles et al. Connecting scientific data to scientific experiments with provenance
Keedy On structuring operating systems with monitors
CN108958903A (en) Embedded multi-core central processing unit method for scheduling task and device
JP2002073929A (en) Archive of workflow management system
CN103631648A (en) Task processing method and system
Queinnec Locality, causality and continuations
Gopinath Programming and execution of object-based, parallel, hard, real-time applications
Kristensen et al. Component composition and interaction
Silberman RTM: Design and implementation
Meister et al. Managing product line variability by patterns
Bahsi Dynamic workflow management for large scale scientific applications

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: MICROSOFT TECHNOLOGY LICENSING LLC

Free format text: FORMER OWNER: MICROSOFT CORP.

Effective date: 20150430

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

Effective date of registration: 20150430

Address after: Washington State

Patentee after: Micro soft technique license Co., Ltd

Address before: Washington State

Patentee before: Microsoft Corp.

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

Granted publication date: 20100915

Termination date: 20190420