Package org.jcsp.lang
Class Spurious
java.lang.Object
org.jcsp.lang.Spurious
This holds the static flag (indicating whether spurious wakeups should be logged)
and early timeout allowance (for
Alternative
s with CSTimer
guards).
Description
These fields are held in this separate class to minimise class loading when spurious wakeups are not logged - the default condition.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic long
This is the allowed early timeout (in msecs).static boolean
If logging is required, this flag should be set before any concurrency is started. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
logging
public static boolean loggingIf logging is required, this flag should be set before any concurrency is started. It should only be set once usingSpuriousLog.start()
. There is no concurrency protection! -
earlyTimeout
public static long earlyTimeoutThis is the allowed early timeout (in msecs). Some JVMs timeout on calls of wait (timeout) early - this specifies how early JCSP will tolerate.We need this to distinguish between a JVM-early timeout (that should be accepted) and a spurious wakeup (that should not). The value to which this field should be set is machine dependant. For JVMs that do not return early timeouts, it should be set to zero. For many, it should be left at the default value (4). If
logging
is enabled, counts of spurious wakeups versus accepted early timeouts on select operations onAlternative
s can be obtained; this field should be set to minimise the former.This field should be set before any concurrency is started. It should only be set once using
SpuriousLog.setEarlyTimeout(long)
. There is no concurrency protection!
-
-
Constructor Details
-
Spurious
Spurious()
-