Language characteristics Join Java




1 language characteristics

1.1 join methods
1.2 ordering modifiers
1.3 asynchronous methods





language characteristics

the join java extension introduces 3 new language constructs:



join methods
asynchronous methods
order class modifiers determining order patterns matched

concurrency in popular programming languages implemented using constructs such semaphores , monitors. libraries emerging (such java concurrency library jsr-166) provide higher-level concurrency semantics. communicating sequential processes (csp), calculus of communicating systems (ccs) , pi have higher-level synchronization behaviours defined implicitly through composition of events @ interfaces of concurrent processes. join calculus, in contrast, has explicit synchronization based on localized conjunction of events defined reduction rules. join semantics try provide explicit expressions of synchronization without breaching object-oriented idea of modularization, including dynamic creation , destruction of processes , channels.


the join java language can express virtually published concurrency patterns without explicit recourse low-level monitor calls. in general, join java programs more concise java equivalents. overhead introduced in join java higher-level expressions derived join calculus manageable. synchronization expressions associated monitors (wait , notify) located in body of methods can replaced join java expressions (the join methods) form part of method signature.


join methods

a join method defined 2 or more join fragments. join method execute once fragments of join pattern have been called. if return type standard java type leading fragment block caller until join pattern complete , method has executed. if return type of type signal leading fragment return immediately. trailing fragments asynchronous not block caller.


example:



ordering modifiers

join fragments can repeated in multiple join patterns there can case when multiple join patterns completed when fragment called. such case occur in example below if b(), c() , d() a() called. final a() fragment completes 3 of patterns there 3 possible methods may called. ordered class modifier used here determine join method called. default , when using unordered class modifier pick 1 of methods @ random. ordered modifier methods prioritised according order declared.


example:



asynchronous methods

asynchronous methods defined using signal return type. has same characteristics void type except method return immediately. when asynchronous method called new thread created execute body of method.


example:








Comments

Popular posts from this blog

Expenses controversy Ian Gibson (politician)

Mobility.2C training and insignia Impi

11th century parish church of St Leonard Hythe, Kent