Home > Archive > MS SQL Server OLAP > March 2006 > Why won't DSO multi-thread ???









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Why won't DSO multi-thread ???
Al

2006-03-14, 7:24 am

Hi,

I've written a little app, in C# with the 1.1 .Net Framwork, to process
partitions. It can use multiple threads to connect to the same AS2000
database and process the partitions. The work list is divided up between the
thread instances before they are started, so we know they are not blocking
each other. And any given cube is not processed by more than 1 thread.

When we run with 2 threads, on a 2 CPU machine, our through-put drops by 30%.
If we run 2 instances of the APP, with 1 thread each, our through-put goes
up by 30%.

It seems that clsPartition.Processs method is the sticking point, although
each thread has it's own instance. Is this something to with the properties
of the clsPartition class?
Vladimir Chtepa

2006-03-14, 9:24 am

Hi,

Do you set MTA/STA attribute respectively?
Do you open connection with server in the same thread as it used?

IMHO, it is better to use multiple processes to interoperate with COM-world
(DSO) definitively from one thread. (I make so too).

Vladimir

"Al" <Al@discussions.microsoft.com> schrieb im Newsbeitrag
news:C0A65E28-1151-4163-B10F- 996BC47FFD2B@microso
ft.com...
> Hi,
>
> I've written a little app, in C# with the 1.1 .Net Framwork, to process
> partitions. It can use multiple threads to connect to the same AS2000
> database and process the partitions. The work list is divided up between
> the
> thread instances before they are started, so we know they are not blocking
> each other. And any given cube is not processed by more than 1 thread.
>
> When we run with 2 threads, on a 2 CPU machine, our through-put drops by
> 30%.
> If we run 2 instances of the APP, with 1 thread each, our through-put goes
> up by 30%.
>
> It seems that clsPartition.Processs method is the sticking point, although
> each thread has it's own instance. Is this something to with the
> properties
> of the clsPartition class?



Steve G

2006-03-14, 11:24 am

If you are trying to process multiple partitions or dimensions in parallel
using .net code which calls AS2K DSO, forget it. DSO is COM, and the code
will serialize in the COM calls even if you create multiple threads from your
own .net code. To do it, you need to create a seperate program (or use the
processpartition.exe utility to do the processing) and then create/launch
multiple processes from your .net code in the background. The .net code can
poll those processes and check when they have completed.

Steve Green

"Al" wrote:

> Hi,
>
> I've written a little app, in C# with the 1.1 .Net Framwork, to process
> partitions. It can use multiple threads to connect to the same AS2000
> database and process the partitions. The work list is divided up between the
> thread instances before they are started, so we know they are not blocking
> each other. And any given cube is not processed by more than 1 thread.
>
> When we run with 2 threads, on a 2 CPU machine, our through-put drops by 30%.
> If we run 2 instances of the APP, with 1 thread each, our through-put goes
> up by 30%.
>
> It seems that clsPartition.Processs method is the sticking point, although
> each thread has it's own instance. Is this something to with the properties
> of the clsPartition class?

Jéjé

2006-03-14, 8:24 pm

try the parrallel process utility.


"Al" <Al@discussions.microsoft.com> wrote in message
news:C0A65E28-1151-4163-B10F- 996BC47FFD2B@microso
ft.com...
> Hi,
>
> I've written a little app, in C# with the 1.1 .Net Framwork, to process
> partitions. It can use multiple threads to connect to the same AS2000
> database and process the partitions. The work list is divided up between
> the
> thread instances before they are started, so we know they are not blocking
> each other. And any given cube is not processed by more than 1 thread.
>
> When we run with 2 threads, on a 2 CPU machine, our through-put drops by
> 30%.
> If we run 2 instances of the APP, with 1 thread each, our through-put goes
> up by 30%.
>
> It seems that clsPartition.Processs method is the sticking point, although
> each thread has it's own instance. Is this something to with the
> properties
> of the clsPartition class?



Al

2006-03-29, 9:30 am

Hi Steve,

Got it to work in the end.

The trick was to set the apartment state of my work threads to STA.

It seems counter-intuitive, but it really works. The CPU utilization is up,
run time is down and the Analysis Services performance counters show that we
are processing more than one partition at a time.

I don't really understand it, but what I THINK is that when I didn't set the
apartment state of my worker threads, it was treating it a MTA. But the DSO
objects were ALL created within the same STA. With the worker threads set to
STA, the DSO objects were created in seperate STA apartments.

If I'm talking rubbish, please let me know, as I would like to understand
this area better.

Alastair

"Steve G" wrote:
[color=darkred]
> If you are trying to process multiple partitions or dimensions in parallel
> using .net code which calls AS2K DSO, forget it. DSO is COM, and the code
> will serialize in the COM calls even if you create multiple threads from your
> own .net code. To do it, you need to create a seperate program (or use the
> processpartition.exe utility to do the processing) and then create/launch
> multiple processes from your .net code in the background. The .net code can
> poll those processes and check when they have completed.
>
> Steve Green
>
> "Al" wrote:
>
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com