1. We do this. 2. We use these callbacks 3. We do, including exception handling. What we have done is have parent threads ping the worker threads for alive status. If they are not alive, locked up somehow, first we check IsBlocking() and it is, then we call CancelBlocking() which causes an exception which we then handle and can get out of the locked state. But because this software is communication intensive, it's used for semi-realtime applications that cannot ever lose connection, this is not a satisfactory solution. To answer previous poster, we constantly send messages. One application combination uses one message per second one way, plus other communication originating from both sides. Another application sends at least one message per second, plus otehr communication from both sides frequently (every few seconds kByte sized packets).
Peter Sjostrom
Posts
-
Expoert advice on MFC TCP/IP sockets, please? -
Expoert advice on MFC TCP/IP sockets, please?Thanks, I'll read the link. I doubt we have any bugs. The software's are three years aold and are installed at numerous customers and have been disected over and over again to find these problems. We've reaching a point where we are convinsed it's a Windows/MFC/WinSock problem. We don't suspect network hardware, since it's running on numerous environments using various network cards, routers, switches and configurations. It's also running on both W2000 and NT4 enviroments, sometimes mixed.
-
Expoert advice on MFC TCP/IP sockets, please?I seriously suspect MFC's socket implementation is broken. We have developed commercial software based on the MFC CSocket and CAsyncSocket classes. We've used the MFC examples using CFile and CArchive for communication. We have separate software using these classes and they all seems to suffer from the same problem: sockets lockup. When it happens communication stops one way until the socket is closed and a new connection is opened. Anyone here know of any problems in MFC sockets? Will they be solved if we re-write using WinSock, C raw sockets or whatever? What is an expert's advice?
-
Super BowlFor the rest of the world that play handball with the hands and football with the feet, the European Championship final in Handball last night was amazing! Germany lead 26 to 25 when 11 seconds remained of the 2x30 minute match. Sweden had taken out the goalkeeper for an extra field player and Staffan Ohlsson used the 7 to 5 man advantage and took a shot and scored with 6 seconds to go. The Germans rush up to the middle line and throws the ball into the empty Swedish net 1 second before the end, but the referee had not started the game after the goal and it was disallowed! So, the match goes into 10 minute overtime where Sweden dominated and finally won 33 to 31 to become European champions. Now, can someone explain why americans insist on calling their rugby/handball game football, any real football player knows it is in violation to the original rules to touch the ball with their hands? :-)
-
Task Manager process CPU usage?Oops, thanks a lot! I will digest this in upcoming days :omg:
-
Task Manager process CPU usage?Ok, some guesswork and trial and error... First, as with another article I found on the net, the processor time parameter is Windows language dependant: csPath.Format("\\Processor(%d)\\%% processor time", iProcessor); changes into: csPath.Format("\\Processor(%d)\\%% processortid", iProcessor); ...to work on my Swedish Windows. I don't know how to find this for any language yet. To find the CPU Usage for a specific process use: csPath.Format("\\Process(%s)\\%% processortid", sProcess); for example: csPath.Format("\\Process(iexplore)\\%% processortid"); for Internet Explorer CPU usage. This does what I want now, except for that language dependency which I must solve now... (anyone know?)
-
Task Manager process CPU usage?Well, thanks, it helps to get started on CPU Usage, but it's not what I want. What I want is to measure the CPU Usage for my specific process. I want to know how much CPU my own software is taking, the software that this code is going to go into. I want to know if my software starts to grab 90+ % of the CPU, if it does it's an error situation and action needs to be taken. Task Manager can obviously do it, but I am unable to find out how to do. I'm reading the PDH docs on MSDN, but it's a bit over my head and I thought someone had done it, or maybe the Task Manager code is available somewhere?
-
Task Manager process CPU usage?I managed to find PDH.DLL which uses either WMI or Registry data. I can get CPU usage from here, MSDN also contains docs on this DLL. Only problem now is I can't understand how to get process CPU usage, which functions, do I use Counters etc, how do I set them up? An example would be perfect. :-)
-
Task Manager process CPU usage?Hi, I know how to use the PSI.DLL (was it?) for checking a process' memory usage etc. But how can I get information about each process' CPU usage? I want to include a CPU usage bar in my software to display how much CPU that software is using. Hints anyone?
-
Can someone help me modify this article? Please, please, please, please, please, please, please, please, please, please, please, please, please.Will this do? http://www.codeproject.com/useritems/changerowheight.asp
-
Repost: CSocket help needed*shrug*, yes, I've read this before... if I could only understand why it's locking I think we could use CSocket. We do use it in similar applications that doesn't communicate so much.
-
Repost: CSocket help neededI use a CSocket derived class with a derived CWinThread class and use CArchive with it. For some yet unknown reason Send() locks after a while of running (hours). The opened socket has communication initiated from both client and server at times, if that helps. (Server sends tiny data once per second, client sends kB data occasionally, like every 10 seconds or so, plus both sides sends an ACK byte for every command) Anyway, since I cannot find the reason of the locking, I want to get around the locked state. I want to make something from the outside and would like to have an OnIdle timer reset at intervals in the CWinThread. A parent thread will check this timer and if it isn't reset in reasonable time (seconds) the parent thread will call CancelBlockingCall() on the locked socket. Now, will this work? Isn't it illegal to call the CSocket object function from another thread? :confused:
-
Scary thoughtsI can't see the original post, but linking monarchy to dictatorship is BS. Sweden is a monarchy state. Sweden is also a democracy with public elections and a parlament where any party receiving more than 4 % of the national votes will get representation corresponding to the number of votes in the 349 seat chamber. We have a Prime Minister and our Royal King does not have political power, but do represent our country. :-O
-
CSocket::CancelBlockingCall() from another thread?I use a CSocket derived class with a derived CWinThread class and use CArchive with it. For some yet unknown reason Send() locks after a while of running (hours). The opened socket has communication initiated from both client and server at times, if that helps. (Server sends tiny data once per second, client sends kB data occasionally, like every 10 seconds or so, plus both sides sends an ACK byte for every command) Anyway, since I cannot find the reason of the locking, I want to get around the locked state. I want to make something from the outside and would like to have an OnIdle timer reset at intervals in the CWinThread. A parent thread will check this timer and if it isn't reset in reasonable time (seconds) the parent thread will call CancelBlockingCall() on the locked socket. Now, will this work? Isn't it illegal to call the CSocket object function from another thread?
-
CSocket::CancelBlockingCall() from another thread?Crap, I saw the drop box display "Visual C++" and thought I was in the right area... thanks.
-
CPU Type for Visual StudioIf you want most out of your system for your money, buy the AMD. Forget all rumours of incompatibilities, that's all old anyway. Athlon dual 1200 MP vs dual Xeon 4 1700 and more: http://www.aceshardware.com/Spades/read.php?article\_id=45000203 Athlon single 1400, single 1200 MP and dual 1200 MP vs Pentium 4 1500 and dual P3 800: http://www.aceshardware.com/Spades/read.php?article\_id=30000193 As you can see an Athlon 1200 MP is faster than a P4 1.5 GHz when using MSVC. Also, a dual Athlon 1200 MP is faster than a dual Xeon 1.7 GHz!
-
I'm BoredMy collegue just scanned her computer a moment ago, she felt it was getting slow: 78 infected files including SIRCAM, CIH and other Trojan viruses, at least 5 different ones! Want some? :-)
-
CSocket::CancelBlockingCall() from another thread?I use a CSocket derived class with a derived CWinThread class and use CArchive with it. For some yet unknown reason Send() locks after a while of running (hours). The opened socket has communication initiated from both client and server at times, if that helps. (Server sends tiny data once per second, client sends kB data occasionally, like every 10 seconds or so, plus both sides sends an ACK byte for every command) Anyway, since I cannot find the reason of the locking, I want to get around the locked state. I want to make something from the outside and would like to have an OnIdle timer reset at intervals in the CWinThread. A parent thread will check this timer and if it isn't reset in reasonable time (seconds) the parent thread will call CancelBlockingCall() on the locked socket. Now, will this work? Isn't it illegal to call the CSocket object function from another thread?
-
what are threads and processes"... so process is running program each thread have its own registers like ax,bx,CS:IP. Right ?" Not my expertise, but I think so, yes. "Use threads the same memory - memory of process ???" Same EXE image, yes. Global variables/objects is also shared between threads within a process. Locally defined variables/objects within a thread are not shared between threads. "can one process access threads of another process?" Don't think so. "one more question: is it ok to create around 20 threads/process - for example each thread for each wininet download ???" Yes, web servers usually contain many more threads than 20. Our company has software running 50+ threads also, a lot being threads with different tasks. Word uses a separate thread to print documents too, for example.
-
Help de-activating system menu in windowYou are right and I agree. However, the code is 6 years old and very complex (read bad). I was just hoping someone had a solution so I won't have to re-write all this code, also risking introducing bugs. Oh, well, off we go...