Package jline.io

Class LQN2QN

java.lang.Object
jline.io.LQN2QN

public class LQN2QN extends Object
Converts a LayeredNetwork (LQN) to a Network (QN) using REPLY signals.

Java port of matlab/src/io/LQN2QN.m; the two must stay in step.

Construction

  • One station per host processor (scheduling and multiplicity taken from the processor). Tasks sharing a processor share the station, as in the LQN semantics where the processor is the contended resource.
  • One Delay per reference task, holding its think time.
  • One closed class per step of the expanded activity graph. A step is an activity, or one call stage of an activity that issues synchronous calls. Steps of the reference task chain carry population 0 except the think class, which carries the reference task multiplicity.
  • A synchronous call site blocks its caller: the step class has a REPLY signal bound to it, the token proceeds to the callee, and the callee's replying activity class-switches to that signal, which returns to the caller station and unblocks it.
  • Call multiplicity mean m is unrolled into floor(m) mandatory call stages plus, if m is not integer, one further stage entered with probability m-floor(m).
  • OR-branch and loop probabilities are read from the activity graph weights. Each call site receives its own copy of the callee subgraph.
  • AND precedences become Fork and Join nodes, with one Router per branch since a Fork cannot switch class per output link. A branch tail that issues a synchronous call is given a merge step, so that it reaches the Join in an ordinary class rather than as a REPLY signal, which carries no forked-task identity.
  • A CacheTask becomes a Cache node. The activity bound to an ItemEntry is the read step and sits on that node; its two CacheAccess successors become the hit and the miss class, and since the class switch is performed by the Cache node itself, the routes leaving it are written in the successor class.
  • An asynchronous call is lowered to a non-blocking visit: the caller does not hold its server for the duration of the call, but it is serialised behind it, since a closed network has no means of creating the second token that a truly concurrent send would require.
  • Entry forwarding splits the reply exits of the forwarding entry: with the forwarding probability the request is handed to the target entry, which replies to the original caller, so the forwarder is released while the caller stays blocked.
  • Phase-2 activities, the successors of a replying activity, run after the reply: the replying step's exit routes back to the caller, and each of its service completions spawns the continuation at the host station (sn.classspawn). The spawned token walks the phase-2 subgraph holding only the task's own thread and is destroyed at the chain end, through a NEGATIVE signal that always misses on a closed chain, or through the Sink on an open one. A boundary that ends on a call site is normalised through a merge step at the host station; a phase 2 that opens with an AND-fork spawns into an immediate head that feeds the Fork; at an AND-join branch tail the spawned token inherits the fork identity of the trigger and stands in for it at the Join; at a cache read the reply is emitted by an immediate trigger step per hit/miss outcome, whose completion spawns the matching branch continuation.
  • An AND-join quorum k of n is applied to the Join node in the class that entered the Fork; k equal to the branch count is the default wait-for-all and is left alone. An activity think time becomes an extra step on a shared ActivityThink delay, in series with the host demand, so the task keeps its thread for it while its processor is released.
  • Replication is represented in one of two ways, selected by the replication argument. Under materialisation each replica of a processor is a station of its own and each replica of a task carries its own copy of the expanded step graph, its own reply signals and its own admission row; a call from replica i of the caller reaches the fan-out block {(i*f+k) mod r} of the callee replicas and splits its call mean uniformly over them, which is deterministic pairing at f=1 and a uniform broadcast at f=r. Under pooling the replicas of a processor collapse into one station of r times the servers, a replicated thread pool into one admission row of r times the bound, and a replicated reference task into one class of r times the population; that is exact at an infinite-server host and optimistic elsewhere, since pooled servers share one queue while the replicas hold r separate ones.
  • A CacheTask with delayed-hit retrieval gets a retrieval system, which is an ordinary queueing network: one PS fetch station per cache replica, entered and left by the read class, with the Cache node coalescing concurrent misses of the same item. The fetch is what the miss branch does, so the miss activity's host demand moves onto that station; calls issued by the miss activity stay outside the retrieval system and are warned.

    A SetupTask carries its setup and delay-off times onto its host station as the Queue setup/delay-off pair, per step class: the server shuts down after the delay-off idle period and pays the setup on the next arrival. An infinite-server processor never shuts down, so the pair is dropped there with a warning, as is a setup with no delay-off time.

    Not yet represented: retrieval on a cache read with phase-2 successors and the thread pool of a task with an internal AND-fork. Each is reported through line_warning.

    See Also:
    • Method Details

      • convert

        public static Network convert(LayeredNetwork lqn)
        Converts a LayeredNetwork to an equivalent queueing network using REPLY signals.
        Parameters:
        lqn - the LayeredNetwork model to convert
        Returns:
        a Network that models the LQN behaviour with REPLY signal blocking
      • convert

        public static Network convert(LayeredNetwork lqn, String replication)
        Converts a LayeredNetwork to an equivalent queueing network using REPLY signals.
        Parameters:
        lqn - the LayeredNetwork model to convert
        replication - how task and processor replication is represented: "auto" materialises the replicas while the expansion stays within the instantiation budget and pools them otherwise, "materialize" always materialises, "pool" always pools
        Returns:
        a Network that models the LQN behaviour with REPLY signal blocking