Threads - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Multithreaded Programming : Threads/Sleep

Threads

  

Sleep

  

pause the execution of the engine

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Sleep( n )

Parameters

n

-

(numeric) the number of seconds to sleep

Description

• 

The Sleep function pauses the execution of the Maple engine for a specified length of time.  While paused, the engine will not use CPU resources.

• 

n is the number of seconds the evaluation should wait.  n can be less than 1 for sub-second pauses.

• 

The length of time spent sleeping can be lengthened by other activity on the system, the time necessary to process the call and by the granularity of the system timers.

• 

The Sleep command should not be used to implement synchronization between threads.  Using Sleep to have one thread wait until another thread "is ready" is unreliable.  Use mutexes or condition variables instead.

Examples

withThreads:

tCPUtime:

tRealtime[real]:

Sleep5

time[real]tReal

5.007

(1)

timetCPU

0.004

(2)

Compatibility

• 

The Threads[Sleep] command was introduced in Maple 15.

• 

For more information on Maple 15 changes, see Updates in Maple 15.

See Also

Threads

time

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam