Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dual Processor Issue

Posted on 2002-06-17
5
Medium Priority
?
328 Views
Last Modified: 2013-11-20
Hi,

We are developing a WIn32 application using MFC Sockets. Once a successful connection is established, we are spawning a thread which will get realtime data from a Server whenever RealTime data comes. I am setting the thread priority as THREAD_PRIORITY_HIGHEST

This works fine in a Single Processor machine.

The same program crashes on a dual processor machine.

What could be the reason.

Where can I find Dual Processor and Threading related issues.


Thanks
0
Comment
Question by:gurukg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 16

Expert Comment

by:AlexNek
ID: 7083525
2 gurukg
It is hard to answer without additional information. (Is it every time the same place for crash? In which thread it crached? What program did in this time? ...)

I can suggest thread synchronization problem. For test try to suspend main thread while you read the data. Or play with function:
SetThreadIdealProcessor( HANDLE hThread, DWORD dwIdealProcessor);
0
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 7083630
Your question is VERY general but chances are you have a very SPECIFIC error.

But in general, you have most likely made an error in your coding and made an ASSUMPTION about something w.r.t. the multiple thread.  There are many things that CAN happen in a multi-thread environment that happen differently in a single vs. a dual CPU system.  In fact a single CPU system will NEVER have two threads running at the same time.  It's IMPOSSIBLE since there is only one CPU.  but a dual CPU will have threads running at once and if you assume anything about when things might happen (i.e. order of completion, etc.) you will eventually get burned.

Go back and double check ALL places where you have dependencies between threads and either eliminate them or protect them with "gates" that will make sure that one thread CANNOT pass the gate until the other thread has done whetever it had to do first.

BTW, if the application is crashing you should be able to determine very simply where the problem lies.  Just examine the crash data and find out which thread crashed and where it crashed.  Then look at your code and find out what's wrong....

Run it in the DEBUGGER if you need to.  The VC++ debugger runs multi-threaded apps just fine.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question