Search:
Type: Posts; User: Tannin
Search:
Search took 0.02 seconds.
-
December 9th, 2008, 04:31 AM
Ok, you're right, it would seem as if that last example program (the pure C code) indeed ran out of memory.
My question is still not answered though: The original program bad_allocs with 250 threads...
-
December 8th, 2008, 04:35 PM
because top says the process has 0.0 - 0.1% memory consumption. ;)
top
umm, no? The maximum for EACH processes is 3 GB. Each process has its own virtual address space of 2^32 bytes, 1...
-
December 8th, 2008, 03:12 PM
Interesting thought. I wrote a test program that was supposed to create a lot of threads, all trying to lock the same mutex. Locking the mutex never failed, but it turns out I'm not even able to...
-
December 8th, 2008, 03:12 AM
I've rewritten the test to be less obscure and C-only:
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-
December 6th, 2008, 01:12 PM
Hi,
unfortunately I won't be able to test again until monday. As far as I remember I wasn't able to reproduce the problem with the function call commented out.
Also, googling a bit it seems as...
-
December 6th, 2008, 06:55 AM
I extended the sample a bit with overwritten versions of new and new[] that now explicitly lock a mutex before allocating memory:
static pthread_mutex_t NewMutex;
void* operator new(size_t...
-
December 6th, 2008, 05:33 AM
Hi,
I have been experiencing crashes in a heavily multi-threaded application (up to 1000 threads), that were always related to memory allocation (usually a std::string being resized).
Now, if I...
-
September 30th, 2008, 04:00 PM
Hi,
I'm very sorry if my last post offended people. Personally I consider MFC a part of VC since it's shipped with it and since compiling a MFC Application does not emit a deprecation warning I...
-
September 30th, 2008, 07:01 AM
You are right Philip, catch (...) catches an exception. After some debugging and googling it turns out VC++ violates the standard (again...) by overloading new to throw a CMemoryException which does...
-
September 29th, 2008, 10:45 AM
Sorry if there has been confusion. The catch-block is never entered, there is no code in the application to create this messagebox.
-----------------------------------
Exception handling is set...
-
September 29th, 2008, 08:32 AM
Hi,
I'd like to post a problem on behalf of a colleague and would appreciate your help:
-----------------------
I do have a wicked behaviour regarding dynamic memory allocation with the new...
-
July 16th, 2008, 04:48 AM
Under the hood, a reference is most likely a pointer anyway. The constraints (no reassignment, no initialisation) only allow the compiler to do some more tests. But if you put enough effort into it,...
-
Hmm, I don't know the capabilities of the M16C, but the usualy C functions to sleep for short periods are usleep (unistd.h) or nanosleep (time.h).
As an alternative you could use select (requires...
-
Nooo, sorry I didn't post earlier, but I didn't want to post before I compare what Paul posted with what linux does:
disassembling the code g++ produces I can verify that it calls
...
-
Thank you for your responses.
The fact that std::ostringstream is not copyable is not a problem, because
a) I do not require the copy of stupidostream to be a proper copy of the original because...
-
Hi,
I'm having a problem with overloading std::stringstream.
What I'm trying to achieve is a stringstream that is instantiated only as a temporary and outputs its content on destruction.
Here...
-
December 20th, 2007, 07:20 AM
@laserlight: thanks. Yes, I will have to adjust it to our internal coding standards.
@treuss: since programmers other than myself may have to use the code and instantiate FooBar, I'd prefer to move...
-
December 20th, 2007, 03:14 AM
thanks for your input.
phl's solution seems to do what I need.
Using const as the template parameter doesn't work in the actual program because I also need to provide a "retrieveValue(PAR1*...
-
December 19th, 2007, 04:03 PM
that does make sense, thank you. Too bad there is no nicer way than to cast...
-
December 19th, 2007, 03:26 PM
thank you for your response.
Why does "const PAR1&" translate to "char* const&"? Is there no way to formulate this so that the class actually created has a constructor "Foobar(const char*&...
-
December 19th, 2007, 03:21 PM
Maybe C++0x will contain something like this, but for now, it's just a mess.
the problem with the std::string is that you can not only not retrieve the correct length, you also can not correctly...
-
December 19th, 2007, 12:39 PM
compiling the following code I get the error
"test.cpp:11: error: invalid conversion from ‘const char*’ to ‘char*’
test.cpp:11: error: initializing argument 1 of...
-
December 19th, 2007, 12:27 PM
you're screwed. ;)
Sorry to put it so bluntly but character encodings are just a terrible mess in C/C++.
Before you start, please realize that neither std::string nor std::wstring are aware of...
-
August 2nd, 2007, 08:10 AM
Thanks to you two, this seems like a good suggestion. I'll try that.
-
August 2nd, 2007, 07:02 AM
Thanks, but that doesn't help, because it only prevents including multiple times inside one "translation unit", it doesn't prevent two "translation units", in this case A and B, from containing the...
|
Click Here to Expand Forum to Full Width
|