HPC-GAP --- Reference Manual Release 4.12.1, 2022-10-20 The GAP Group Reimer Behrends Vladimir Janjic The GAP Group Email: mailto:support@gap-system.org Homepage: https://www.gap-system.org Reimer Behrends Email: mailto:behrends@gmail.com Vladimir Janjic Email: mailto:vj32@st-andrews.ac.uk ------------------------------------------------------- Copyright Copyright © (1987-2022) for the core part of the GAP system by the GAP Group. Most parts of this distribution, including the core part of the GAP system are distributed under the terms of the GNU General Public License, see https://www.gnu.org/licenses/gpl.html or the file GPL in the etc directory of the GAP installation. More detailed information about copyright and licenses of parts of this distribution can be found in 'Reference: Copyright and License'. GAP is developed over a long time and has many authors and contributors. More detailed information can be found in 'Reference: Authors and Maintainers'. ------------------------------------------------------- Contents (hpc) 1 Tasks 1.1 Overview 1.2 Running tasks 1.2-1 RunTask 1.2-2 ScheduleTask 1.2-3 DelayTask 1.2-4 RunAsyncTask 1.2-5 ScheduleAsyncTask 1.2-6 MakeTaskAsync 1.2-7 ImmediateTask 1.2-8 ExecuteTask 1.2-9 WaitTask 1.2-10 WaitAnyTask 1.2-11 TaskResult 1.2-12 CullIdleTasks 1.3 Information about tasks 1.3-1 TaskSuccess 1.3-2 TaskError 1.3-3 CurrentTask 1.3-4 RunningTasks 1.3-5 TaskStarted 1.3-6 TaskFinished 1.3-7 TaskIsAsync 1.4 Cancelling tasks 1.4-1 CancelTask 1.4-2 TaskCancellationRequested 1.4-3 OnTaskCancellation 1.4-4 OnTaskCancellationReturn 1.5 Conditions 1.6 Milestones 1.6-1 NewMilestone 1.6-2 ContributeToMilestone 1.6-3 AchieveMilestone 1.6-4 IsMilestoneAchieved 2 Variables in HPC-GAP 2.1 Global variables 2.2 Thread-local variables 2.2-1 MakeThreadLocal 2.2-2 BindThreadLocal 2.2-3 BindThreadLocalConstructor 2.2-4 ThreadVar 3 How HPC-GAP organizes shared memory: Regions 3.1 Thread-local regions 3.2 Shared regions 3.3 Ordering of shared regions 3.4 The public region 3.5 The read-only region 3.6 Migrating objects between regions 3.7 Region names 3.8 Controlling access to regions 3.9 Functions relating to regions 3.9-1 NewRegion 3.9-2 NewLibraryRegion 3.9-3 NewSystemRegion 3.9-4 NewKernelRegion 3.9-5 NewInternalRegion 3.9-6 NewSpecialRegion 3.9-7 RegionOf 3.9-8 RegionPrecedence 3.9-9 ShareObj 3.9-10 ShareLibraryObj 3.9-11 ShareSystemObj 3.9-12 ShareKernelObj 3.9-13 ShareInternalObj 3.9-14 ShareSpecialObj 3.9-15 ShareSingleObj 3.9-16 ShareSingleLibraryObj 3.9-17 ShareSingleSystemObj 3.9-18 ShareSingleKernelObj 3.9-19 ShareSingleInternalObj 3.9-20 ShareSingleSpecialObj 3.9-21 MigrateObj 3.9-22 MigrateSingleObj 3.9-23 LockAndMigrateObj 3.9-24 IncorporateObj 3.9-25 AtomicIncorporateObj 3.9-26 AdoptObj 3.9-27 AdoptSingleObj 3.9-28 LockAndAdoptObj 3.9-29 CopyRegion 3.9-30 IsPublic 3.9-31 IsThreadLocal 3.9-32 IsShared 3.9-33 HaveReadAccess 3.9-34 HaveWriteAccess 3.9-35 MakeReadOnlyObj 3.9-36 MakeReadOnlySingleObj 3.9-37 IsReadOnlyObj 3.9-38 SetRegionName 3.9-39 ClearRegionName 3.9-40 RegionName 3.9-41 ViewShared 3.9-42 UNSAFE_VIEW 3.9-43 The atomic statement. 3.10 Atomic functions 3.11 Write-once functionality 3.11-1 BindOnce 3.11-2 TestBindOnce 3.11-3 BindOnceExpr 3.11-4 TestBindOnceExpr 3.11-5 StrictBindOnce 4 Console User Interface 4.1 Console UI commands 4.1-1 !shell [name] 4.1-2 !fork [name] 4.1-3 !list 4.1-4 !kill id 4.1-5 !break id 4.1-6 !name [id] name 4.1-7 !info id 4.1-8 !hide [id|*] 4.1-9 !watch [id|*] 4.1-10 !keep num 4.1-11 !prompt (id|*) string 4.1-12 !prefix (id|*) string 4.1-13 !select id 4.1-14 !next 4.1-15 !previous 4.1-16 !replay num [id] 4.1-17 !id 4.1-18 !source file 4.1-19 !alias shortcut expansion 4.1-20 !unalias shortcut 4.1-21 !eval expr 4.1-22 !run function string 4.2 GAP functions to access the Shell UI 4.2-1 TextUIRegisterCommand 4.2-2 TextUIForegroundThread 4.2-3 TextUIForegroundThreadName 4.2-4 TextUISelectThread 4.2-5 TextUIOutputHistory 4.2-6 TextUISetOutputHistoryLength 4.2-7 TextUINewSession 4.2-8 TextUIRunCommand 4.2-9 TextUIWritePrompt 5 Atomic objects 5.1 Atomic lists 5.1-1 AtomicList 5.1-2 FixedAtomicList 5.1-3 MakeFixedAtomicList 5.1-4 FromAtomicList 5.1-5 ATOMIC_ADDITION 5.1-6 COMPARE_AND_SWAP 5.2 Atomic records and component objects 5.2-1 AtomicRecord 5.2-2 FromAtomicRecord 5.3 Replacement policy functions 5.3-1 MakeWriteOnceAtomic 5.3-2 MakeStrictWriteOnceAtomic 5.3-3 MakeReadWriteAtomic 5.4 Thread-local records 5.4-1 ThreadLocalRecord 5.4-2 SetTLDefault 5.4-3 SetTLConstructor 6 Thread functions 6.1 Thread functions 6.1-1 CreateThread 6.1-2 WaitThread 6.1-3 CurrentThread 6.1-4 ThreadID 6.1-5 KillThread 6.1-6 PauseThread 6.1-7 ResumeThread 6.1-8 InterruptThread 6.1-9 SetInterruptHandler 6.1-10 NewInterruptID 6.1-11 MAX_INTERRUPT 7 Channels 7.1 Channels 7.1-1 CreateChannel 7.1-2 SendChannel 7.1-3 TransmitChannel 7.1-4 TrySendChannel 7.1-5 TryTransmitChannel 7.1-6 ReceiveChannel 7.1-7 TryReceiveChannel 7.1-8 MultiSendChannel 7.1-9 TryMultiSendChannel 7.1-10 MultiReceiveChannel 7.1-11 ReceiveAnyChannel 7.1-12 ReceiveAnyChannelWithIndex 7.1-13 TallyChannel 7.1-14 InspectChannel 8 Semaphores 8.1 Semaphores 8.1-1 CreateSemaphore 8.1-2 WaitSemaphore 8.1-3 SignalSemaphore 8.1-4 Simulating locks 9 Synchronization variables 9.1 Synchronization variables 9.1-1 CreateSyncVar 9.1-2 SyncWrite 9.1-3 SyncRead 10 Serialization support 10.1 Serialization support 10.1-1 SerializeToNativeString 10.1-2 DeserializeNativeString 10.1-3 InstallTypeSerializationTag 10.1-4 InstallSerializer 10.1-5 InstallDeserializer 11 Low-level functionality 11.1 Explicit lock and unlock primitives 11.1-1 LOCK 11.1-2 TRYLOCK 11.1-3 UNLOCK 11.2 Hash locks 11.2-1 HASH_LOCK 11.2-2 HASH_UNLOCK 11.2-3 HASH_LOCK_SHARED 11.2-4 HASH_UNLOCK_SHARED 11.3 Migration to the public region 11.3-1 MAKE_PUBLIC 11.3-2 MAKE_PUBLIC_NORECURSE 11.4 Memory barriers 11.4-1 ORDERED_WRITE 11.4-2 ORDERED_READ 11.5 Object manipulation 11.5-1 SWITCH_OBJ 11.5-2 FORCE_SWITCH_OBJ