Threads - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Threads

tools for parallel programming

 

Calling Sequence

Description

List of Threads Package Commands

List of Threads Subpackages

Calling Sequence

Threads:-command(arguments)

command(arguments)

Description

• 

The Threads package provides user-level commands for writing parallel code in Maple.  This allows multiple paths of execution to run concurrently. This can allow Maple to perform a greater number of computations per second when running on a multi-core machine.  See multithreaded for more information.

• 

The best tool for parallel programming in Maple is the Task Programming Model.

• 

Each command in the Threads package can be accessed by using either the long form or the short form of the command name in the command calling sequence.  For more information, see the UsingPackages help page.

List of Threads Package Commands

Add

Create

Map

Mul

Self

Seq

Sleep

Wait

• 

The Create function creates a new thread and evaluates a Maple expression in that thread.

• 

The Wait function suspends the execution of the current thread until a group of running threads has terminated.  The Sleep function pauses the execution for a specified length of time.

• 

The Self function returns the thread identifier of the current thread.

• 

The Add, Map, Mul, and Seq functions are parallelized versions of the traditional add, map, mul, and seq functions.

List of Threads Subpackages

ConditionVariable

Mutex

Task

 

• 

The Task subpackage provides a high-level programming interface for developing parallel code.  The Task interface is the preferred interface for developing parallel code.

• 

The Mutex subpackage provides functions to control access to shared data structures. By using mutexes, one can create sections of code that can be executed only by one thread at a time.

• 

The ConditionVariable subpackage provides functions that allow threads to synchronize their execution.  Using condition variables, threads can pause their execution until they are signaled by another thread.

See Also

examples,Task

examples,Threads

help

module

multithreaded

Threads[ConditionVariable]

Threads[Mutex]

Threads[Task]

UsingPackages

with