• Narrow screen resolution
  • Wide screen resolution
  • Increase font size
  • Decrease font size
  • Default font size
  • default color
  • green color
  • blue color
Member Area
You are here:
FireBoard
Welcome, Guest
Please Login or Register.    Lost Password?
cognitive psychology defined Thread Deadlock Problem. (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: cognitive psychology defined Thread Deadlock Problem.
#15542
Keaven Pineau (Visitor)
Click here to see the profile of this user
Birthdate:
cognitive psychology defined Thread Deadlock Problem.  
Hello all, I did a dialog application with an utility class with 2 working threads in it that are calling callback functions of the xxxdlg class. Thead A is my main working thread.  This thread his waiting on 2 events : 1- Quit Event 2- Optional callback call Event This thread is calling a callback function on every WaitForMultiple_object_s() timeout, here 5000 ms. Thread B is an optional thread that can be enable/disable at anytime.  This thread his waiting only a quit Event and when WaitForSingle_object_() timeout it is setting the Optional Event of Thread A via SetEvent().  Timeout here is 15 000 ms. Each Thread are calling AfxEndThread(0,FALSE); at the end and the control function is waiting on A-m_hThread and/or B-m_hThread before deleting their respective _object_. Now, if I am not enabling thread B.  I can start and end Thread A without any issue.  If I start both thread A and B and I can also quit them without problem if they were both running.  Now , If I start both thread A and B and stopping thread B and waiting a 10 seconds when I will try to stop thread A the WaitForSingle_object_() on his handle will deadlock. I have found out that it is related with the event I am using for telling thread A to execute the optional callback.  If I simply put the SetEvent() in comment, the problem never occurs. Any idea, why this is happening? Thank you
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#15543
cognitive psychology defined Thread Deadlock Problem.  
I did a dialog application with an utility class with 2 working threads in it that are calling callback functions of the xxxdlg class. Thead A is my main working thread.  This thread his waiting on 2 events : 1- Quit Event 2- Optional callback call Event This thread is calling a callback function on every WaitForMultiple_object_s() timeout, here 5000 ms. Thread B is an optional thread that can be enable/disable at anytime. This thread his waiting only a quit Event and when WaitForSingle_object_() timeout it is setting the Optional Event of Thread A via SetEvent(). Timeout here is 15 000 ms. Each Thread are calling AfxEndThread(0,FALSE); at the end and the control function is waiting on A-m_hThread and/or B-m_hThread before deleting their respective _object_. Now, if I am not enabling thread B.  I can start and end Thread A without any issue.  If I start both thread A and B and I can also quit them without problem if they were both running.  Now , If I start both thread A and B and stopping thread B and waiting a 10 seconds when I will try to stop thread A the WaitForSingle_object_() on his handle will deadlock. I have found out that it is related with the event I am using for telling thread A to execute the optional callback.  If I simply put the SetEvent() in comment, the problem never occurs. Any idea, why this is happening? Thank you
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#15544
cognitive psychology defined Thread Deadlock Problem.  
Thank you Joseph M. Newcomer [MVP] email: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#15545
Hector Santos (Visitor)
Click here to see the profile of this user
Birthdate:
cognitive psychology defined Thread Deadlock Problem.  
Hello all, I did a dialog application with an utility class with 2 working threads in it that are calling callback functions of the xxxdlg class. Thead A is my main working thread.  This thread his waiting on 2 events : 1- Quit Event 2- Optional callback call Event This thread is calling a callback function on every WaitForMultiple_object_s() timeout, here 5000 ms. Thread B is an optional thread that can be enable/disable at anytime.   This thread his waiting only a quit Event and when WaitForSingle_object_() timeout it is setting the Optional Event of Thread A via SetEvent().   Timeout here is 15 000 ms. Each Thread are calling AfxEndThread(0,FALSE); at the end and the control function is waiting on A-m_hThread and/or B-m_hThread before deleting their respective _object_. Now, if I am not enabling thread B.  I can start and end Thread A without any issue.  If I start both thread A and B and I can also quit them without problem if they were both running.  Now , If I start both thread A and B and stopping thread B and waiting a 10 seconds when I will try to stop thread A the WaitForSingle_object_() on his handle will deadlock. I have found out that it is related with the event I am using for telling thread A to execute the optional callback.  If I simply put the SetEvent() in comment, the problem never occurs. Any idea, why this is happening? Thank you
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#15546
Hector Santos (Visitor)
Click here to see the profile of this user
Birthdate:
cognitive psychology defined Thread Deadlock Problem.  
**** I have found out that it is related with the event I am using for telling thread A to execute the optional callback.  If I simply put the SetEvent() in comment, the problem never occurs. **** Callbacks are dangerous as a way of life, especially in C++.  Try to avoid ever using them.  The are an old C hack, rarely, if ever, valid in C++. -1.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#15547
cognitive psychology defined Thread Deadlock Problem.  
**** I have found out that it is related with the event I am using for telling thread A to execute the optional callback.  If I simply put the SetEvent() in comment, the problem never occurs. **** Callbacks are dangerous as a way of life, especially in C++.  Try to avoid ever using them.  The are an old C hack, rarely, if ever, valid in C++. -1. **** However, if you examine the use of most callbacks, they are just C hacks transformed to C++, usually badly.  For example, how many callbacks really carry a user-defined value with them?  Even Microsoft totally screwed this up, and in 20+ years, has not fixed it with some of the enum callbacks, making them impossible to use in C++.  I did not say avoid them , I said try to avoid ever using them .  That's because there are often much better approaches to the problem than a callback.  It was reflexive for C programmers to toss a callback into the mix whenever they felt like it; it is less neccessary in C++, and is often best handled by passing in an _object_ of an abstract superclass with a pure virtual method defined by the DLL interface, except what is passed in is actually an instance of the derived class whose virtual method is specified.  While this sort-of-looks-like a callback, it is philosophically quite different from the C hack, and is a cleaner solution in the C++ world.                                 joe **** Joseph M. Newcomer [MVP] email: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
 

Who's Online

We have 40 guests online
Age of an elephant

Age is related to the elephant teeth. Teeth of the elephant is six left rental home guide Used auto motors.online-auto.co.uk and six right-hand molars - but they do not grow simultaneously and successively. The front surface of the tooth, where clashes between crumbles, gradually fall off from it are small, thin plates and consequently the tooth decreases. Then in his place moves to the next tooth. The first three teeth of the elephant, the milk teeth. They consume in the first nine best.used-auto.org.uk Reviews articles articles.used-moto.co.uk years of age. The fourth tooth has used the elephant to complete the 20 - Up 25 years. Sixth tooth - the last, which is the size of bricks appear in the age of 45 years and his job is to serve the elephant for 20 years. Then the elephant becomes toothless. Due to the large (approximately 150 kg) required a daily ration of food, this situation does not end well - elephant dies quickly, since it is able to provide the body enough food.

What is a perfect number?

Prime number is called the integer which is equal to the sum of all mieszkania i nieruchomoƛci Good cars Great reviews smaller than itself. In antiquity, formerly known 6,28,496,8128 four such numbers. Another fifth of the number 33550336 was a great German mathematician Regiomontanus. Another German mathematician, was the sixth and seventh perfect number. Euler had found eighth prime number. With the mathematical machinery found another perfect number. So far, 39 were found excellent numbers.

Water-powered mobile phones on the market in 2010

Samsung Electro-Mechanics has developed a battery powered water into the cells. According to carfinance-offers.co.uk top.moto-used.co.uk Reviews what we read on the Samsung, when incorporated into the cell, metal and water in the phone react, formed hydrogen. Gas flows into the cell, where he reacts with oxygen. New this so that other hydrogen cells need methanol to produce a Samsung device, only water. One micro-cell can produce three watts of power and as the Samsung is able to power the phone for car.online-auto.co.uk www.world-auto.co.uk news.moto-used.co.uk 10 hours non-stop conversation. This with an average of four hours per day talks, hydrogen cartridge would have to be replaced every five days. Samsung engineers from laboratories are confident that they could simplify the procedure, reducing load the phone for occasional topping up the water. The first device on the market may already be there for two years.


Ceramika
Ceramika
stron
stron, strona
kredyt bez BIK
kredyt bez BIK
organizacja konferencji
organizacja konferencji
biustonosze dla mam
biustonosze dla mam