PerThreadMailboxes
public class PerThreadMailboxes<
Message: MergeableMessage,
Graph: GraphProtocol
>: MailboxesProtocol where Graph.VertexId: IdIndexable
Mailboxes that allow communication without synchronization.
Note: messages are delivered only once.
-
Initializes
self
for a given graph size.Declaration
Swift
public init(vertexCount: Int, threadCount: Int)
-
A mailbox that merges messages together.
See moreDeclaration
Swift
public struct Mailbox : MailboxProtocol
-
Transfers messages that were previously sent into the inboxes of the verticies.
Declaration
Swift
public func deliver() -> Bool
-
Initialize mailboxes for
graph
formessageType
messages.This initializer helps the type inference algorithm along.
Declaration
Swift
public convenience init<SequentialGraph: VertexListGraph & ParallelGraph>( for graph: __shared SequentialGraph, sending messageType: Type<Message> = .init() ) where SequentialGraph.ParallelProjection == Graph