Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default strange behaviour for the multi-threaded calculation in Excel 2007


Hello world!

I observe a strange behaviour for the multi-threaded calculation in Excel
2007 with my XLL.
I have 2 functions A and B exported by the xll. They are registered as
threadsafe.
A is registered with R$.
B is registered with RR$

The function B depends on the result of the function A.
On a worksheet, I can decla
- =A() in cell A1
- =B(A1) in cell A2

When I disable multi-threaded calculation, =A() is executed before =B(A1)
because B depends on the result of =A().
But, when I enable multi-threaded calculation, Excel runs A and B on
different threads. The function B failed with xlretUncalced when it called
xlCoerce. Excel launches again B after the execution of A. Why does excel
calculate B and A at the same time at the beginning?

Thanks for any suggestions.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default strange behaviour for the multi-threaded calculation in Excel 2007

Hi Guillaume,

I have not done many experiments on calculation sequence with multi-threaded
functions, but I think this is what is happening:

If you do not have multithreaded calculation enabled the order of
calculation is dictated by the previous calculation chain. After you have
completed a calculation A will be executed before B. But if you then go to
Manual Calculation and re-enter =A() in cell A1 and =B(a1) in cell A2 this
will place A2 at the top of the calculation chain so when you Press F9 the
calculation sequence will be
A2 (xlretUncalced)
A1
A2

So it is always possible that functions will be executed with uncalculated
arguments, even with multi-threading switched off.

When you switch on Multi-threading I would have expected the same behaviour:
so that if you do 2 successive recalculations the second recalculation would
always calculate in the correct order: but perhaps it behaves differently :
you can test by switching on Multi-threaded Calculation and doing
Ctrl/alt/F9 twice

Let me know what happens with the test!

Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"Guillaume" wrote in message
...

Hello world!

I observe a strange behaviour for the multi-threaded calculation in Excel
2007 with my XLL.
I have 2 functions A and B exported by the xll. They are registered as
threadsafe.
A is registered with R$.
B is registered with RR$

The function B depends on the result of the function A.
On a worksheet, I can decla
- =A() in cell A1
- =B(A1) in cell A2

When I disable multi-threaded calculation, =A() is executed before =B(A1)
because B depends on the result of =A().
But, when I enable multi-threaded calculation, Excel runs A and B on
different threads. The function B failed with xlretUncalced when it called
xlCoerce. Excel launches again B after the execution of A. Why does excel
calculate B and A at the same time at the beginning?

Thanks for any suggestions.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi threaded calculation (multi CPU) - impact on calculation spe Pascal[_2_] Excel Discussion (Misc queries) 1 December 3rd 08 10:46 AM
Multi-threaded calculation and VBA jorma Excel Programming 0 August 26th 07 10:34 AM
Selection.Cells vs Range reference - strange behaviour (using 2007 Tara H Excel Programming 7 August 21st 07 05:20 PM
Strange Excel behaviour Corey Excel Programming 6 May 29th 07 03:13 AM
Excel is multi threaded program? thanks maplemaple[_2_] Excel Programming 3 January 15th 06 10:20 PM


All times are GMT +1. The time now is 11:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"