Caveats associated with dual processor systems

B

Ben Fidge

My client has upgraded their server to dual-Xeon and we're getting some
strange symptoms. Mostly this is happening in static classes where static
properties and members aren't protected, but also strange things like a
booking has been created by User A but the record was saved with User B's
information.

I was wondering, are there any gothcas to look out for when an app is
running on dual processor systems. I understand the granularity of thread
time-slices is down to a single clock-tick. Is there a list of do's and
don't and best practices to follow.

Thanks

Ben
 
S

Scott Allen

My client has upgraded their server to dual-Xeon and we're getting some
strange symptoms. Mostly this is happening in static classes where static
properties and members aren't protected, but also strange things like a
booking has been created by User A but the record was saved with User B's
information.

I was wondering, are there any gothcas to look out for when an app is
running on dual processor systems. I understand the granularity of thread
time-slices is down to a single clock-tick. Is there a list of do's and
don't and best practices to follow.

Thanks

Ben

If the code has race conditions [1], then an MP system can certainly
bring out the worst in the software. It's not because the timeslice
changes, it's because threads really do execute concurrently (instead
of just appearing to execute concurrently on uniproc system).

One approach would be to scour through the code and place locks and
Monitors where appropriate, but a better approach might be to get rid
of the static state where ever possible. It's hard to find all the
places you need a lock. It's easier to write the code so that you
don't have to worry about a lock, or let another service (like a
database) worry about locking.


[1] http://en.wikipedia.org/wiki/Race_condition
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top