problems with multi-processors machine 
Author Message
 problems with multi-processors machine

Hello,

I wrote an Windows NT Service that creates and destroys
threads to manage client transactions requests. The Service
works fine in any Windows NT single processor machine. When
I try to use the application in a multi-processor machine
a doctor Watson window appears telling me an memory error
(the application tried to access the memory location....
access denied), then windows nt kills my process and
everything is over. This error happends sometimes. Not
always appears it and is possible to have the application
running for several days without the error.

I didn't use any precompiler/compiler/linked option
is necessary do that?
is necessary to include some .h file?
my program must have any special code to run in multiple procs.?
anyone has some information related to this?

Any help or comment will be appreciated.
Thanks in advance,

Marc Bonet
--
Is better to know useless things than
don't know anything at all

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Fri, 10 Jan 2003 03:00:00 GMT  
 problems with multi-processors machine

Quote:

>I wrote an Windows NT Service that creates and destroys
>threads to manage client transactions requests. The Service
>works fine in any Windows NT single processor machine. When
>I try to use the application in a multi-processor machine

<snip>

This is a very common occurrence. The threads
in your app have a contention problem. On a
single-processor machine, since two threads
can't actually run at the same time, they aren't
interfering with one another.

On a multi-processor machine, they can actually
be running at the same time, on different processors.

Quote:
>I didn't use any precompiler/compiler/linked option
>is necessary do that?
>is necessary to include some .h file?
>my program must have any special code to run in multiple procs.?

Nope; the bug is all in -your- code.

Long term solution: test and debug on a multi-
processor machine.

Short term fix: call SetProcessAffinityMask()
(check the MSDN documentation) and specify
that your app should only run on one processor.
Do this in your startup code.

Your app will then run the same as on a single
processor machine. The only drawback is you
get no performance boost in your app from
having an extra processor.

Please direct additional questions to the newsgroup,
rather than email, so others may benefit from the
discussion.



Fri, 10 Jan 2003 03:00:00 GMT  
 problems with multi-processors machine


Quote:


> >I wrote an Windows NT Service that creates and destroys
> >threads to manage client transactions requests. The Service
> >works fine in any Windows NT single processor machine. When
> >I try to use the application in a multi-processor machine

> <snip>

> This is a very common occurrence. The threads
> in your app have a contention problem. On a
> single-processor machine, since two threads
> can't actually run at the same time, they aren't
> interfering with one another.

> On a multi-processor machine, they can actually
> be running at the same time, on different processors.

> >I didn't use any precompiler/compiler/linked option
> >is necessary do that?
> >is necessary to include some .h file?
> >my program must have any special code to run in multiple procs.?

> Nope; the bug is all in -your- code.

> Long term solution: test and debug on a multi-
> processor machine.

> Short term fix: call SetProcessAffinityMask()
> (check the MSDN documentation) and specify
> that your app should only run on one processor.
> Do this in your startup code.

> Your app will then run the same as on a single
> processor machine. The only drawback is you
> get no performance boost in your app from
> having an extra processor.

> Please direct additional questions to the newsgroup,
> rather than email, so others may benefit from the
> discussion.

Hello Ron,

I think you are very right, now I'm preparing
an dev environment in my work to test the whole
application with your recomendations in a
multi-processor machine...

When I have any new result, I will send it's to
you in order to comment and learn.

Thanks a Lot,

Marc

Is better to know useless things than
don't know anything at all

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 12 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Setting Affinity on multi processor machines

2. Setting Affinity on multi processor machines

3. CCriticalSection and CSingleLock problem on dual-processor machine?

4. std::ostringstream problem on a multi-processor system

5. C pre-processor to produce machine-specific assembler code

6. Machine Speed and Processor for PC's

7. thread creation on dual processor machine

8. Is VC 5.0 debugger multi-processor proof

9. Multi-Threading in Dual Processor System

10. Does VC++ support multi-processors?

11. CreateThread on multi processor PC

12. Multi-Processor question

 

 
Powered by phpBB® Forum Software