Async UI Calls Block on Dual-Core CPU, work fine on Single Core. Why?

C

costasz

I am using the code from this MSDN article

http://msdn2.microsoft.com/en-us/library/bz33kx67.aspx

Everything worked great on my single core CPU laptop. I then tried to
run the .exe on my Dual core Pentium-D at work. The UI becomes
unresponsive while the background thread is running. When I go into
task manager and change the CPU affinity from 0,1 to just 0, the UI
becomes responsive again. Please keep in mind that made the loop longer
so that I have time to observe the blocking. Anyone have any ideas?

Thanks

CZ
 
S

Sean Chambers

What does the memory consumption look like on the dual core box. You
said you made the loop longer to observe the blocking. Perhaps it's
working so quickly that it chews all your memory up?

Just throwing ideas out there.

I made a multi-threading async app on a dual core box with no problems.
The child threads would update a listbox with updates as they complete
certain tasks in text files. worked like a charm. thats why this is
kind of weird.
 
C

costasz

I had to put a Thread.Sleep(1) inside the Background Thread's loop.
Everything worked then.

Thanks
 
W

Willy Denoyette [MVP]

Please post a complete sample that illustrates the issue, there must be
something wrong with your code.

Willy.

|I had to put a Thread.Sleep(1) inside the Background Thread's loop.
| Everything worked then.
|
| Thanks
|
|
| Sean Chambers wrote:
| > What does the memory consumption look like on the dual core box. You
| > said you made the loop longer to observe the blocking. Perhaps it's
| > working so quickly that it chews all your memory up?
| >
| > Just throwing ideas out there.
| >
| > I made a multi-threading async app on a dual core box with no problems.
| > The child threads would update a listbox with updates as they complete
| > certain tasks in text files. worked like a charm. thats why this is
| > kind of weird.
| >
| > (e-mail address removed) wrote:
| > > I am using the code from this MSDN article
| > >
| > > http://msdn2.microsoft.com/en-us/library/bz33kx67.aspx
| > >
| > > Everything worked great on my single core CPU laptop. I then tried to
| > > run the .exe on my Dual core Pentium-D at work. The UI becomes
| > > unresponsive while the background thread is running. When I go into
| > > task manager and change the CPU affinity from 0,1 to just 0, the UI
| > > becomes responsive again. Please keep in mind that made the loop
longer
| > > so that I have time to observe the blocking. Anyone have any ideas?
| > >
| > > Thanks
| > >
| > > CZ
|
 

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

Top