Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geclipse-dev] Job Status

Hey,

Ariel Garcia pisze:
Looking at eu.geclipse.core.jobs.GridJob.getJobStatus() and readJobStatus() i do not see "millions" of GridJobStatus objects being created for "thousands" of jobs but rather it seems to me a O(1) relationship...
each GridJob has its own private GridJobStatus copy being returned,
new GridJobStatus() being called only if there is no status etc
But for sure Mariusz will enlighten me ;-)

GridJob.getJobStatus() just return last checked job status.

But: GridJob.updateJobStatus() check for new status and creates a new IGridJobStatus object.

IGridJobStatus objects are created similar like String objects. Once object is created, its state isn't changed. If you want to change something in the object, you have to create a new instance.

This design pattern causes, that the same object can be shared by many threads without protection of synchronized methods (critical sections). From time to time we are going into a deadlock, so less synchronized methods is safer :-)

--
Regards,
Mariusz Wojtysiak


Back to the top