On this page:
top
up next →

3Futures TracingπŸ”— i

The futures trace module exposes low-level information about the execution of parallel programs written using future .

syntax

( trace-futures e...)

procedure

( trace-futures-thunk thunk)(listofindexed-future-event? )

thunk:(->any)
The trace-futures macro and trace-futures-thunk function track the execution of a program using futures and return the program trace as a list of indexed-future-event structures.

This program:

(require racket/future
future-visualizer/trace)
(let ([f(future (lambda ()... ))])
...
(touch f)))

Is equivalent to:

(require racket/future
future-visualizer/trace)
(let ([f(future (lambda ()... ))])
...
(touch f))

procedure

( start-future-tracing! )void?

procedure

( stop-future-tracing! )void?

procedure

( timeline-events )(listofindexed-future-event? )

The start-future-tracing! procedure enables the collection of future-related execution data. This function should be called immediately prior to executing code the programmer wishes to profile.

The stop-future-tracing! procedure must be used to indicate the end of code the programmer wishes to trace. Tracing works by simply using a log receiver to record all future-related log events; this procedure logs a special message that is well-known to the log receiver to mean ’stop recording’.

The timeline-events procedure returns the program trace as a list of indexed-future-event structures.

struct

#:extra-constructor-namemake-indexed-future-event)
event:any
Represents an individual log message in a program trace. In addition to future events, the tracing code also records garbage collection events; hence the event field may contain either a future-event or gc-info prefab struct (see Garbage Collection), where the latter describes a GC operation. Because multiple future-event structures may contain identical timestamps, the index field ranks them in the order in which they were recorded in the log output.

struct

(struct future-event ( future-id
proc-id
action
time-id
prim-name
user-data)
#:extra-constructor-namemake-future-event
#:prefab)
action:symbol?
time-id:real?
prim-name:(or symbol? #f)
Represents a future event as logged by the run-time system. See Future Performance Logging for more information.

top
up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /