Solved

Dual Processor Issue

Posted on 2002-06-17
5
318 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 50 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

728 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