Modify

Ticket #136 (closed enhancement: fixed)

Opened 11 years ago

Last modified 7 years ago

Synchronized blocks on expressions of type Object

Reported by: Bernhard Haumacher (haui at haumacher dot de) Owned by:
Priority: normal Milestone: 1.07h
Component: uka.gm Version: 1.07f
Severity: minor Keywords:
Cc:

Description

If a block is synchronized on an expression of type Object, the complier can not decide statically, whether the synchronization will be a remote or a local synchronization at runtime.

Problem

The current transformation creates a double synchronization if the object the synchronization is performed on is a remote object at runtime. If the object is a remote object at runtime, first a lock is acquired on the implementation object, and afterwards a synchronization is performed on the handle object. This synchronization scheme is OK for mutual exclusion, but it does not work signaling on remote objects. If one threads waits in a synchronized block on a remote object, only the lock at the implementation object is released while waiting. Since this thread still holds the monitor of the handle object, another thread that has a reference to the same object handle can not aquire the remote monitor for signaling, because it is blocked at the local handle.

Solution

At runtime the decision must be made, whether the object the synchronization is performed on is a remote or a local object. If it is a local object, only a local synchronization should be performed. If the object is a remote object at runtime, only the lock of the remote implementation object should be set, and no local synchronization should be happen. The problem could be solved in three ways: 1. Duplicating the code of the synchronized block (one copy with local and one copy with remote synchronization). 2. By transforming the synchronized code into a private method of the same class that is called from within a locally synchronized block, or from within a remote monitor access/release pair. 3. By directly creating Java ByteCode and creating a local subroutine for the code within the synchronized block and calling that local subroutine from within local synchronization or from within a remote monitor access/release pair. Possibility 3 is bad, because it breaks the source to source transformation. Possibility 2 is difficult, because it requires a data-flow analysis to identify the values used within the synchronized block and those that may escape the synchronized block. The transformation into a separate method is not possible, if more than one value must be returned from that method. Therefore possibility 1 seems to be the best one.

Test

jp.test.TestSyncBlock

fixed since 1.06d.

Attachments

Change History

comment:1 Changed 7 years ago by anonymous

  • Severity changed from normal to blocker
  • Component changed from JP trafo to uka.lang
  • Priority changed from normal to low
  • Version set to 1.09c
  • Milestone changed from 1.06d to JPlater
  • Type changed from defect to task

keyboard learning piano destination free installation software ware hosting mysql php uk web the monitor newspaper in mcallen texas video hosting services computer system associate database enabled software web real estate settlement software hosting internet provider day trading tax software dating free gay internet service microsoft word 2002 software large key for computer keyboard domain host register web computer cable modem design game house own wedding henna design new york computer electronics new computer software hardware pennsylvania storemac dvd burning software type of computer virus camera internet wireless accessory child computer buy cheap printer ink samsung color laser printer review apple chip computer intel nail polish design design download free landscape 21 fpd2185w lcd monitor business expense small software charter cable internet business check printing software international computer graphic free reason music software free photo stitching software california internet marketing strategic document feed scanner domain eminent jersey new maintenance school software intelligent wireless keyboard oklahoma scanner frequency code online computer store charleston west virginia industrial design company bypassing filter internet pc gaming monitor salsa radio station on the internet web business web site hosting sauder heritage hill computer desk with hutch uniden bearcat handheld scanner

comment:2 Changed 7 years ago by anonymous

  • Severity changed from blocker to critical
  • Component changed from uka.lang to uka.gm
  • Priority changed from low to normal
  • Version changed from 1.09c to 1.04c
  • Milestone changed from JPlater to 1.03h
  • Type changed from task to enhancement

keyboard learning piano destination free installation software ware hosting mysql php uk web the monitor newspaper in mcallen texas video hosting services computer system associate database enabled software web real estate settlement software hosting internet provider day trading tax software dating free gay internet service microsoft word 2002 software large key for computer keyboard domain host register web computer cable modem design game house own wedding henna design new york computer electronics new computer software hardware pennsylvania storemac dvd burning software type of computer virus camera internet wireless accessory child computer buy cheap printer ink samsung color laser printer review apple chip computer intel nail polish design design download free landscape 21 fpd2185w lcd monitor business expense small software charter cable internet business check printing software international computer graphic free reason music software free photo stitching software california internet marketing strategic document feed scanner domain eminent jersey new maintenance school software intelligent wireless keyboard oklahoma scanner frequency code online computer store charleston west virginia industrial design company bypassing filter internet pc gaming monitor salsa radio station on the internet web business web site hosting sauder heritage hill computer desk with hutch uniden bearcat handheld scanner

comment:3 Changed 7 years ago by anonymous

  • Severity changed from critical to major
  • Component changed from uka.gm to uka.karo
  • Priority changed from normal to highest
  • Version changed from 1.04c to 1.00
  • Milestone changed from 1.03h to 1.07g
  • Type changed from enhancement to defect

comment:4 Changed 7 years ago by anonymous

  • Severity changed from major to minor
  • Component changed from uka.karo to uka.gm
  • Priority changed from highest to normal
  • Version changed from 1.00 to 1.07f
  • Milestone changed from 1.07g to 1.07h
  • Type changed from defect to enhancement
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.