Solved

Dual Processor Issue

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 84
unable to delete all specified values regedit 38 885
move a line in eclipse 3 111
haveThree challenge 22 127
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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