Changeset 000d68f for doc/theses/colby_parsons_MMAth/text/actors.tex
- Timestamp:
- Jul 31, 2023, 4:18:49 PM (11 months ago)
- Branches:
- master
- Children:
- 4852232
- Parents:
- d3c3261
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/actors.tex
rd3c3261 r000d68f 251 251 Therefore, it is up to the actor program to manage message life-time across receives. 252 252 However, 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 envelopand a many to one relationship for a message.253 Hence, 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. 254 Managing 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. 255 255 256 256 % In actor systems, messages are sent and received by actors. … … 342 342 343 343 Users 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 perform inga type-system like action.344 As 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. 345 This workaround is outside of the type system, but performs a type-system like action. 346 346 The workaround requires no annotation or additional code to be written by users; 347 347 thus, it resolves the maintenance and error problems. … … 352 352 The routine sets @rec_fn@ to the matching @receive@ routine using the left-hand type to perform the selection. 353 353 Then 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@.354 Finally, the envelope is added to the executor queue designated by the actor using the executor routine @send@. 355 355 356 356 \begin{figure} … … 396 396 \subsection{Actor Termination}\label{s:ActorTerm} 397 397 During 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.398 These 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. 399 399 After the receive routine is done, the executor must clean up the actor and message according to their allocation status. 400 400 If the allocation status is @Delete@ or @Destroy@, the appropriate destructor must be called by the executor. … … 402 402 the derived type of the actor or message is not available to the executor, but it needs to call the derived destructor. 403 403 This requires downcasting from the base type to the derived type, which requires a virtual system. 404 To accomplish the dow cast, I implemented a rudimentary destructor-only virtual system in \CFA.404 To accomplish the downcast, a rudimentary destructor-only virtual system was implemented in \CFA as part of this work. 405 405 This virtual system is used via Plan-9 inheritance of the @virtual_dtor@ type, shown in Figure~\ref{f:VirtDtor}. 406 406 The @virtual_dtor@ type maintains a pointer to the start of the object, and a pointer to the correct destructor. … … 517 517 518 518 Since 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 isno further dynamic allocations.519 For many workloads, the copy queues grow in size to facilitate the average number of messages in flight and there are no further dynamic allocations. 520 520 The downside of this approach is that more storage is allocated than needed, \ie each copy queue is only partially full. 521 521 Comparatively, 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. … … 662 662 However, any form of locking here creates contention between thief and victim. 663 663 664 The alternative to locking is allowing the race and resolving it lazily (lock-free approach).664 The alternative to locking is allowing the race and resolving it lazily. 665 665 % 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. 666 666 % Furthermore, after a thief steals, there is moment when victim gulps but the queue no longer … … 1262 1262 Because $Z$ is contiguous in memory, there can be small cache write-contention at the row boundaries. 1263 1263 1264 Figures~\ref{f:MatrixAMD} and \ref{f:MatrixIntel} show the matrix multipleresults.1264 Figures~\ref{f:MatrixAMD} and \ref{f:MatrixIntel} show the matrix-multiply results. 1265 1265 There are two groupings with Akka and ProtoActor being slightly slower than \uC, \CFA, and CAF. 1266 1266 On 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.