Awesome, you guys were right! I was mixing microseconds and ticks. Once I put in that frequency call, it started working, being off on average by 100 microseconds or less.
Something odd did happen...
Type: Posts; User: Verdagon
Awesome, you guys were right! I was mixing microseconds and ticks. Once I put in that frequency call, it started working, being off on average by 100 microseconds or less.
Something odd did happen...
Hey everyone, I've been using WaitForMultipleObjects in my server, and I find that its fourth argument, the timeout in milliseconds, is *terribly* inaccurate. In 100 tries, of waits of .4 to 3.0...
I just tried running it outside of eclipse, and it worked! On top of that, if I Run from inside eclipse instead of Debug (which I've been doing) then it works. Perhaps I should have tried that...
Just checked my path, it's just C:\MinGW\bin (it's not at the front though).
I just reinstalled MinGW and eclipse, but it's still happening.
Since it didn't happen on your computer, and we're...
Is that what happens when I hit the pause button in eclipse's debugger? I've tried that, but it acts as if the button does nothing... I can't figure out where its happening.
I tried putting in a Sleep(1) and it didn't change anything (it got to 30 out of 100). Then I tried Sleep(1000) and it got to 70 out of 100. Sleep(300) got to 18 out of 1000... dang, for a bit there...
I'm on a windows 7 machine using eclipse indigo CDT, using MinGW.
According to windows batch file to determine MinGW version info my versions are this:
MINGWBASEDIR=C:\MinGW
gcc version...
I added the -pthread, and this is the new compile output:
**** Build of configuration Debug for project TestWFMO ****
**** Internal Builder is used for build ****
g++ -O0 -g3...
My eclipse output shows this for the compile:
**** Rebuild of configuration Debug for project TestWFMO ****
**** Internal Builder is used for build ****
g++ -O0 -g3 -Wall -c...
Yeah, I was thinking about that, but in this case, it's only the main thread accessing cout...
Hey everyone, I found a really, really weird bug! I'm making a multithreaded application, and for some reason, the program just quits halfway through, always in different spots!
And get this, it...
Thanks for the reply! Indeed the Sleep was just for testing, and thanks for the tips on WSAStartup and the order of closing the event.
The original plan was to use listen() and accept() after the...
Hey everyone, I'm having some trouble using WaitForMultipleObjects to wait for incoming connections (which I would later accept()).
My code simply uses one thread to start listening, and then uses...
It's not important what port the client's socket is on on the client machine.
The line where I specify the port on the remote machine, the one that is between 13337 and 13346, is the line:
...
Hi all, I have a server program which starts up on any one of the 10 ports from 13337 to 13346.
I just opened a socket with this:
// create the socket
socket = ::socket( AF_INET, SOCK_DGRAM,...
@jim: wouldn't that be slower? I need both speed and non-buffering.
@Raigne: that's a good idea. i'll give it a shot, thanks!
I can't be buffering things like that though. My program crashes, and the last few statements are vital to figuring out where the crash happened.
Sup all, I'm using cout a lot in my program in multiple threads. I'm crashing in one of the threads, but I haven't a clue where. My job would be a lot easier if the threads' cout's weren't...
Hey all, I have an interesting predicament. In my debugging, I need to print out a massive number of debug statements, unbuffered (so i know where exactly im crashing), on every frame of my real-time...
So a while ago, I was playing around with C# and designing forms, and I saw they had a really cool variable called "tag" that was in all of their form objects (buttons, text fields, labels, etc.).
...
Just curious, is it faster to read from ram, write to ram, or are they the same?
I'm guessing they're the same, but I've been surprised before...
But isn't that a lot of overhead per call?
If there's no easy way to do it, I suppose I can code my own list class that will do this... I was hoping there was something simple I was missing.
Right, it shouldn't have failed, but for my purposes, I wish it did. I know why it doesn't fail; I need to know a way to make it so it does fail, so my team doesn't accidentally modify this list.
...
Hello, gods of c++! I beseech you, lay upon me your vast and infinite knowledge of purity of code.
It all started with this:
class Level {
public:
list<Rock *> rocks;
...
You have no idea how glad I am to hear that. Another project I'm working on requires that hash map be faster than a binary tree. Thanks for running that benchmark!
I would have run it on another...