Ignore:
Timestamp:
Jul 31, 2023, 4:18:49 PM (11 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
4852232
Parents:
d3c3261
Message:

various small changes across entire thesis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/colby_parsons_MMAth/text/actors.tex

    rd3c3261 r000d68f  
    251251Therefore, it is up to the actor program to manage message life-time across receives.
    252252However, for a message to appear on multiple message queues, it needs an arbitrary number of associated destination behaviours.
    253 Hence, there is the concept of an envelop, which is dynamically allocated on each send, that wraps a message with any extra implementation fields needed to persist between send and receive.
    254 Managing the envelop is straightforward because it is created at the send and deleted after the receive, \ie there is 1:1 relationship for an envelop and a many to one relationship for a message.
     253Hence, there is the concept of an envelope, which is dynamically allocated on each send, that wraps a message with any extra implementation fields needed to persist between send and receive.
     254Managing the envelope is straightforward because it is created at the send and deleted after the receive, \ie there is 1:1 relationship for an envelope and a many to one relationship for a message.
    255255
    256256% In actor systems, messages are sent and received by actors.
     
    342342
    343343Users could be expected to write the @?|?@ routines, but this approach is error prone and creates maintenance issues.
    344 Until the \CFA type-system matures, I created a workaround using a template-like approach, where the compiler generates a matching @?|?@ routine for each @receive@ routine it finds with the correct actor/message type-signature.
    345 This workaround is outside of the type system, but performing a type-system like action.
     344As a stopgap until the \CFA type-system matures, a workaround was created using a template-like approach, where the compiler generates a matching @?|?@ routine for each @receive@ routine it finds with the correct actor/message type-signature.
     345This workaround is outside of the type system, but performs a type-system like action.
    346346The workaround requires no annotation or additional code to be written by users;
    347347thus, it resolves the maintenance and error problems.
     
    352352The routine sets @rec_fn@ to the matching @receive@ routine using the left-hand type to perform the selection.
    353353Then the routine packages the actor and message, along with the receive routine into an envelope.
    354 Finally, the envelop is added to the executor queue designated by the actor using the executor routine @send@.
     354Finally, the envelope is added to the executor queue designated by the actor using the executor routine @send@.
    355355
    356356\begin{figure}
     
    396396\subsection{Actor Termination}\label{s:ActorTerm}
    397397During a message send, the receiving actor and message being sent are stored via pointers in the envelope.
    398 These pointers are the base actor and message types, so type information of the derived actor and message is lost and must be recovered later when the typed receive routine is called.
     398These pointers have the base actor and message types, so type information of the derived actor and message is lost and must be recovered later when the typed receive routine is called.
    399399After the receive routine is done, the executor must clean up the actor and message according to their allocation status.
    400400If the allocation status is @Delete@ or @Destroy@, the appropriate destructor must be called by the executor.
     
    402402the derived type of the actor or message is not available to the executor, but it needs to call the derived destructor.
    403403This requires downcasting from the base type to the derived type, which requires a virtual system.
    404 To accomplish the dowcast, I implemented a rudimentary destructor-only virtual system in \CFA.
     404To accomplish the downcast, a rudimentary destructor-only virtual system was implemented in \CFA as part of this work.
    405405This virtual system is used via Plan-9 inheritance of the @virtual_dtor@ type, shown in Figure~\ref{f:VirtDtor}.
    406406The @virtual_dtor@ type maintains a pointer to the start of the object, and a pointer to the correct destructor.
     
    517517
    518518Since the copy queue is an array, envelopes are allocated first on the stack and then copied into the copy queue to persist until they are no longer needed.
    519 For many workload, the copy queues grow in size to facilitate the average number of messages in flight and there is no further dynamic allocations.
     519For many workloads, the copy queues grow in size to facilitate the average number of messages in flight and there are no further dynamic allocations.
    520520The downside of this approach is that more storage is allocated than needed, \ie each copy queue is only partially full.
    521521Comparatively, the individual envelope allocations of a list-based queue mean that the actor system always uses the minimum amount of heap space and cleans up eagerly.
     
    662662However, any form of locking here creates contention between thief and victim.
    663663
    664 The alternative to locking is allowing the race and resolving it lazily (lock-free approach).
     664The alternative to locking is allowing the race and resolving it lazily.
    665665% As mentioned, there is a race between a victim gulping and a thief stealing because gulping partitions a mailbox queue making it ineligible for stealing.
    666666% Furthermore, after a thief steals, there is moment when victim gulps but the queue no longer
     
    12621262Because $Z$ is contiguous in memory, there can be small cache write-contention at the row boundaries.
    12631263
    1264 Figures~\ref{f:MatrixAMD} and \ref{f:MatrixIntel} show the matrix multiple results.
     1264Figures~\ref{f:MatrixAMD} and \ref{f:MatrixIntel} show the matrix-multiply results.
    12651265There are two groupings with Akka and ProtoActor being slightly slower than \uC, \CFA, and CAF.
    12661266On the Intel, there is an unknown divergence between \uC and \CFA/CAF at 24 cores.
Note: See TracChangeset for help on using the changeset viewer.