The Thread of a Java should be type of race to control from beginning to end. This that is to say, the light process that the line Cheng of programming language of a Java should resemble Solaris works euqally. The ” of Cheng of “ green line that Runnable interface can use at defining type of a Solaris, this line Cheng is indispensible the Cheng of other green line that can turn control advantageous position to move in identical and light process.
For example, current grammar:
Produce Cheng of line of a green effectively for Runnable object, bind it in deciding the light progress that represents by Thread object. This kind of implementation to having code it is transparent, because of its effectiveness and existing just the same.
Miss Runnable target to become green line Cheng, use this kind of method, need to pass boy or girl friend of a few Runnable to the tectonic function of Thread only, with respect to the existing grammar of programming language of OK and patulous Java, there is Cheng of many greens line in order to support in Cheng of an onefold and light line. (an OK and mutual cooperation of green line Cheng, but they can be run in other light process (Thread object) the green course that attend (Runnable object) race to control. ) . For example, the code below can found Cheng of line of a green for every Runnable object, these green line Cheng can share the light progress that represents by Thread object.
Show some enclothing (the habit that Override)Thread object realizes Run() continues effective, but it answers the green line Cheng that map goes to to be bound to decide one light process. (In Thread() kind meeting interiorly establishs medium default Run() method effectively object of the 2nd Runnable. (In Thread() kind meeting interiorly establishs medium default Run() method effectively object of the 2nd Runnable..
The cooperation between line Cheng
More functions should be joined in the language in order to support the mutual communication between line Cheng. Current, pipedInputStream and PipedOutputStream kind can use at this purpose. But use a program to great majority, they are too weak. I suggest to Thread kind join following function: Add method of a Wait_for_start() , it is in block condition normally, start till the Run() method of Cheng of a line. (If await line Cheng is released before calling Run, this does not have what problem) . With this kind of method, cheng of a line can found Cheng of one or more auxiliary line, before assuring to founding line Cheng to continue to execute an operation, these auxiliary line Cheng can be in moving condition. (to Object kind) add $send (Object O) and Object=$receive() method, they will use an in-house block to break alignment the object conveys between online Cheng Zhi. Block breaks the by-product that alignment should call as the first $send() to be founded automatically. $send() is called can join the object alignment. $receive() is called be in block condition normally, until an object is joined alignment, next it returns this object. The variable in this kind of method should support set to enter team and the operation overtime that give a group ability: $send (Object O, long Timeout) and $receive (long Timeout) .
Previous 1 2 3 4 5 6 78 9 10 11 12 13 Next