Question: Can someone show a few simple multithread examples ...

This question is related to the Question Can I limit cpu usage with threads

Okay, many questions here, maybe someone can answer one or two of them for me?  Can someone show a few simple multi-thread examples that work starting from version Maple 12 ?  Actually what version does multithreading actually really start working to improve calculation times? 

From what I understand the Threads package was introduced in Maple12 so it's almost experimental there.  An example I found using add() and Add() shows a slight increased in time calculations, I managed to check also on Maple15 but for the same add() Add() example I didn't see much of a change.   

with(Threads):
Statistics[Mean]([seq(time(add(1/i, i = 1 .. 100000)), j = 1 .. 10)])
                                                  1.1964

Statistics[Mean]([seq(time(Add(1/i, i = 1 .. 100000)), j = 1 .. 10)])  
                                                  1.2916

On the Adept scientific website, it states for Maple12 "the kernel now automatically shifts from single thread to multi-threaded when Threads are used.  Can someone create an example to show more threads being used?  Maybe it doesn't actually work in Maple 12, I don't know. 

One other thing I noticed changing kernelopts(numcpus=5) increases the time to calculate Add() slightly but not add(). 

kernelopts(numcpus=5)
Statistics[Mean]([seq(time(add(1/i, i = 1 .. 50000)), j = 1 .. 10)])
                                                   1.3199

Statistics[Mean]([seq(time(Add(1/i, i = 1 .. 50000)), j = 1 .. 10)])
                                                    1.9449

The difference is slight but my question is why does it cost more time?  It either doesn't work properly or I am missing the basic understanding of it's use.  I can also never seem to increase the number of active threads above 2.

kernelopts(numactivethreads)
                                                           1

I know Maple 15 has substantial improvements in parallel programming and multithreading so I'm not really questioning Maple 15's abilities.  but  .. How far can we push Maple 12, 13 or 14 and use an example to illustrate the facts? 

Please Wait...