next up previous
Next: Restricted type conversion Up: Operators Previous: Operators

Operator new

When new is used to allocate global variables in the program, the new data are created on the current active process group. In HPJava, there is an optional on clause, which can be used after new operator to specify the data owner group. Here again, it should be noticeed that the active process group as an executor of new is different from the data owner group, the one specified by the on clause.

  on(p) {
    int # s = new int # on q;

will create a global scalar similar but different to the one created in the following,

  on (p) {
    int # s = new int #;

In the first fragment, the data descriptor is duplicated on all process in Group p, but for those not in Group q, the data reference field of the descriptor is undefined.

We also have accessibility problem here. One can not define,

  on (q) 
    int # s = new int # on p;

Bryan Carpenter 2002-07-12