dev-cpp-users Mailing List for Dev-C++ (Page 317)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <and...@su...> - 2003-09-19 19:38:37
|
Dear Users, In C codes, some functions don´t need the respective #include header file command, like printf, system(blah...), etc. Other specific functions do (pow versus math.h) Why this happens? Regards Andre |
|
From: <kom...@eu...> - 2003-09-18 18:21:07
|
I tried both perfect and imperfect dependency with no luck. now I would like to get Dev-CPP sources and fix it myself but currently My download link is 0.5 kb/s (technical problems) my mailbox is delivered via satellite so if some kind soul would e-mail me Entire DEV-CPP CVS Tree in .tar.gz or .rar format I would really apreciate it. Regards, kom...@eu... >Hello, >You should try to uncheck in Compiler Options: Use fast but imperfect >dependcy checking. This will slow down the compile process a little but you >should get real dependency checking. >Greetings, >Colin >I have a header file in my project. when I change something in it, I >would expect that all .cpp files that include this header file get >recompiled. Why is it not working ? >Dev-C++ 4.9.8.1 |
|
From: <co...@ps...> - 2003-09-18 07:59:03
|
Hi all, I use DEV-CPP build-in gdb interface. Watches are removed every time when debbuger is launched. Is it possible to keep their in debug watches window? Thanks in advance Regards Collins |
|
From: Qintus <Qi...@se...> - 2003-09-18 07:56:07
|
Hello, I have Win32 program which uses SetTimer(), WM_TIMER and KillTimer() fo= r writing actual time to file. Program compiles and runs normally, but = WindowProcedure() dont receive any message WM_TIMER. I found on internet page, where is mentioned "Support of timer in Win95= is not good, use timer from Win98 higher." Is this true, or is problem in Dev-cpp version 4.01? Thanks for any answers and ideas, Ian ____________________________________________________________ Evoluce nekon=E8=ED! =AEijte ve stylu 21. stolet=ED, =BEijte na MAX. Vy= zkou=B9ejte si j=EDzdu v nov=E9m Ford Focus C-MAX a vyhrajte. http://ad= 2.bbmedia.cz/please/redirect/126/12/8/7/?param=3D3152/3830_1<div style=3D= "position:absolute;"><iframe src=3D"http://netmonitor.idot.cz/akcejs.ph= p?c=3D111105" scrolling=3D"No" width=3D"1" height=3D"1" marginwidth=3D"= 0" marginheight=3D"0" frameborder=3D"No" style=3D"border-style: none;">= </iframe><!-- end --></div> |
|
From: Colin L. <ha...@bl...> - 2003-09-18 07:30:40
|
Hello, You should try to uncheck in Compiler Options: Use fast but imperfect dependcy checking. This will slow down the compile process a little but you should get real dependency checking. Greetings, Colin On Thursday 18 September 2003 09:18, you wrote: > I have a header file in my project. when I change something in it, I > would expect that all .cpp files that include this header file get > recompiled. Why is it not working ? > > Dev-C++ 4.9.8.1 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: <kom...@eu...> - 2003-09-18 07:18:57
|
I have a header file in my project. when I change something in it, I would expect that all .cpp files that include this header file get recompiled. Why is it not working ? Dev-C++ 4.9.8.1 |
|
From: Jonathan G. <jgi...@ca...> - 2003-09-18 06:58:24
|
confirm 266871 |
|
From: Vlada D. <dj...@im...> - 2003-09-18 06:51:51
|
----- Original Message ----- From: "Smitha V. Babu" <smi...@so...> To: <dev...@li...> Sent: Thursday, September 18, 2003 7:19 AM Subject: [Dev-C++] tutorial for win32 programming... > hi to all, > Can anyone suggest a good tutorial for win32 programming... > Thanks in advance > rgds > smitha > > Try the Forger's Win32 tutorial on www.winprog.org > ********************************************************************* > Disclaimer: The information in this e-mail and any attachments is > confidential / privileged. It is intended solely for the addressee or > addressees. If you are not the addressee indicated in this message, you may > not copy or deliver this message to anyone. In such case, you should destroy > this message and kindly notify the sender by reply email. Please advise > immediately if you or your employer does not consent to Internet email for > messages of this kind. > ********************************************************************* > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Smitha V. B. <smi...@so...> - 2003-09-18 06:07:16
|
hi to all, Can anyone suggest a good tutorial for win32 programming... Thanks in advance rgds smitha ********************************************************************* Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. ********************************************************************* |
|
From: Ed C. <em...@ed...> - 2003-09-18 03:01:41
|
Per, Santiago, & Reid -
Thanks for your help! I ended up assigning memory from the main thread
(since the RTL was not thread-safe). Once I did that and cleaned up a =
bunch
of excessive pointer use (I was passing too many arguments to the thread
routine as pointers), it worked perfectly: no thread lock-ups, and I'm
actually getting the maximum possible throughput on my DSL connection.
That's thanks in no small part to those on this list. Thank you! Without =
the
help of this group, I would be struggling for many hours to come.
-Ed
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Per
Westermark
Sent: Wednesday, September 17, 2003 3:21 PM
To: Ed Cottrell
Cc: dev...@li...
Subject: RE: [Dev-C++] Multi-Threading locks up
No, I didn't say it is forbidden to allocate memory in the individual
threads. It's just that you must make sure that the RTL is multi-thread
safe.
Correct me someone, but for MinGW you have to specify -mthreads to the
linker when you build the project.
new/malloc/calloc are not the only RTL functions that may fail in a
multithreaded app. The random generator, and a number of date/time =
functions
etc are using static variables and buffers and may because of that fail
spectacularly.
If you build on an environment when the compiler can't supply a =
thread-safe
RTL, then you must manually protect any calls to RTL functions that =
might
use static state information.
/Per W
On Wed, 17 Sep 2003, Ed Cottrell wrote:
> Per,
>
> It seems like that's probably the root of my problem... This is my=20
> first multi-threaded app in a language without a garbage collector /=20
> built-in memory management (like Java).
>
> So, does this mean I need to allocate all memory for the threads from=20
> within the main thread? For example, one of the thread-level variables =
> for each thread is a memory buffer of 50k for batching SQL statements. =
> If I understand you, then, I need to allocate that memory from the=20
> main thread and only let one thread access it. Is that what you're=20
> saying?
>
> -Ed
>
> P.S. How would I do the memory locking you describe, under Win32? I'm=20
> plenty familiar with the concept, but don't know how to implement it=20
> in C.
>
>
> -----Original Message-----
> From: Per Westermark [mailto:pw...@ia...]
> Sent: Wednesday, September 17, 2003 1:48 PM
> To: Ed Cottrell
> Cc: dev...@li...
> Subject: Re: [Dev-C++] Multi-Threading locks up
>
>
> I think you have a problem with shared memory. While each new thread=20
> shares the same memory space with the parent, they should - must - not =
> access the same memory at the same time.
>
> 1 - are you linking with a thread-safe RTL, i.e. if the threads=20
> allocates memory new/malloc/calloc will break if not thread-safe. The=20
> same goes for the calls to open the connection to the database.
>
> 2 - All memory used in the threads should either be on the stack,=20
> dynamically allocated or indexed into an array - one entry for each=20
> thread.
>
> 3 - If you have to access the same global variable from the different=20
> threads, or for a child thread and the main thread, you have to=20
> protect the access with a critical section, mutex, spinlock or similar =
> to assert serialized access.
>
> /Per W
>
> On Wed, 17 Sep 2003, Ed Cottrell wrote:
>
> > Hi,
> >
> > I'm working on a multi-threaded database app, which connects to=20
> > multiple databases and does data-mining. The main thread (which=20
> > includes the Win32
> > GUI) launches off a user-specified number of threads (say, 10),=20
> > which then do the actually database queries.
> >
> > I've hit a weird snag, though. As written, the threads all start=20
> > properly, but then pause themselves, immediately, or almost=20
> > immediately (after updating 0 to maybe 500 records, out of several=20
> > hundred thousand). The problem isn't on the database server end; it=20
> > works fine, but reports that the threads have stopped running=20
> > queries.
> > Pseudo-code:
> >
> > ...
> > int i, MyThreads=3D10;
> > for(i =3D 0; i < MyThreads; i++)
> > {
> > //Splits up the work, here, into MyThreads chunks
> > _beginthread( [the arguments] )
> > }
> > ...
> >
> > This is where it gets weird... IF I create a message box first, the=20
> > threads start properly AND run until finished! Pseudo-code:
> >
> > ...
> > int i, MyThreads=3D10;
> > char mymsg[10]
> > for(i =3D 0; i < MyThreads; i++)
> > {
> > //Splits up the work, here, into MyThreads chunks
> > _beginthread( [the arguments] )
> > sprintf(mymsg, "%d", i);
> > MessageBox(0, mymsg, mymsg, MB_OK);
> > }
> > ...
> >
> > The ONLY difference is in whether or not I show a message box.=20
> > Anybody know what that's about? Thanks a million!
> >
> > -Ed
> >
> >
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf=20
> _______________________________________________
> Dev-cpp-users mailing list Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: P.D. v. Z. <pa...@my...> - 2003-09-17 22:37:50
|
Right, now the question has been answered, I just have to say something.
I'd like an array of pints as well :D
Alright, not funny... :)
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Per
Westermark
Sent: Thursday, September 18, 2003 12:24 AM
To: Esteban Valverde
Cc: dev-cpp
Subject: Re: [Dev-C++] Problems with arrays of pinters
Correct.
/Per W
On Wed, 17 Sep 2003, Esteban Valverde wrote:
> So... char *str2 = "sldfksf" must be undertaken like a read-only
> string, whereas char str2[ ] = "sldfksf" is a read-write string ?
>
> ----- Original Message -----
> From: "Per Westermark" <pw...@ia...>
> To: "Esteban Valverde" <est...@ho...>
> Cc: "dev-cpp" <dev...@li...>
> Sent: Wednesday, 17 September, 2003 16:24 PM
> Subject: Re: [Dev-C++] Problems with arrays of pinters
>
>
> Note that when you declare a text string as
>
> char *str2 = "sldfksf"
>
> str2 is only a pointer to a text. Most compilers will place the text
> in read-only memory, i.e. if you try to follow the pointer to change
> the text, you will get a memory access violation.
>
> If you want to change a text you must use the array form of
> declaration.
>
> /Per W
>
> On Wed, 17 Sep 2003, Esteban Valverde wrote:
>
> > Hi, the next code has an running error, non a compiler error.
> > Anybody can understand it ?
> >
> > thanks, Esteban
> >
> >
> > char str1[] = "Hello, how ";
> > char *str2 = "are you ?";
> >
> > char *pstr[2];
> >
> > // these works fine...
> > pstr[0] = str1;
> > pstr[1] = str2;
> >
> > // these works fine...
> > printf("%s%s\n", pstr[0], pstr[1]);
> >
> > // these works fine...
> > if(*pstr[0] == 'H')
> > printf("\"%s\" start with 'H'\n", pstr[0]);
> >
> > if(*pstr[1] != 'x')
> > printf("\"%s\" don't start with 'X'\n", pstr[1]);
> >
> > // I'm attempting to increment 'H' to 'I'.
> > // these works fine...
> > (*pstr[0])++;
> > printf("%s\n", pstr[0]);
> >
> > // I'm attempting to increment 'a' to 'b'.
> > // these, doesn't works fine...
> > // these halts the computer... the same with (*(pstr[1]))++
> > (*pstr[1])++; printf("%s\n", pstr[1]);
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Dev-cpp-users mailing list Dev...@li...
> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Per W. <pw...@ia...> - 2003-09-17 22:25:34
|
Correct.
/Per W
On Wed, 17 Sep 2003, Esteban Valverde wrote:
> So... char *str2 = "sldfksf" must be undertaken like a read-only string,
> whereas char str2[ ] = "sldfksf" is a read-write string ?
>
> ----- Original Message -----
> From: "Per Westermark" <pw...@ia...>
> To: "Esteban Valverde" <est...@ho...>
> Cc: "dev-cpp" <dev...@li...>
> Sent: Wednesday, 17 September, 2003 16:24 PM
> Subject: Re: [Dev-C++] Problems with arrays of pinters
>
>
> Note that when you declare a text string as
>
> char *str2 = "sldfksf"
>
> str2 is only a pointer to a text. Most compilers will place the text in
> read-only memory, i.e. if you try to follow the pointer to change the
> text, you will get a memory access violation.
>
> If you want to change a text you must use the array form of declaration.
>
> /Per W
>
> On Wed, 17 Sep 2003, Esteban Valverde wrote:
>
> > Hi, the next code has an running error, non a compiler error. Anybody can
> > understand it ?
> >
> > thanks, Esteban
> >
> >
> > char str1[] = "Hello, how ";
> > char *str2 = "are you ?";
> >
> > char *pstr[2];
> >
> > // these works fine...
> > pstr[0] = str1;
> > pstr[1] = str2;
> >
> > // these works fine...
> > printf("%s%s\n", pstr[0], pstr[1]);
> >
> > // these works fine...
> > if(*pstr[0] == 'H')
> > printf("\"%s\" start with 'H'\n", pstr[0]);
> >
> > if(*pstr[1] != 'x')
> > printf("\"%s\" don't start with 'X'\n", pstr[1]);
> >
> > // I'm attempting to increment 'H' to 'I'.
> > // these works fine...
> > (*pstr[0])++;
> > printf("%s\n", pstr[0]);
> >
> > // I'm attempting to increment 'a' to 'b'.
> > // these, doesn't works fine...
> > // these halts the computer... the same with (*(pstr[1]))++
> > (*pstr[1])++;
> > printf("%s\n", pstr[1]);
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Esteban V. <est...@ho...> - 2003-09-17 21:40:03
|
So... char *str2 = "sldfksf" must be undertaken like a read-only string,
whereas char str2[ ] = "sldfksf" is a read-write string ?
----- Original Message -----
From: "Per Westermark" <pw...@ia...>
To: "Esteban Valverde" <est...@ho...>
Cc: "dev-cpp" <dev...@li...>
Sent: Wednesday, 17 September, 2003 16:24 PM
Subject: Re: [Dev-C++] Problems with arrays of pinters
Note that when you declare a text string as
char *str2 = "sldfksf"
str2 is only a pointer to a text. Most compilers will place the text in
read-only memory, i.e. if you try to follow the pointer to change the
text, you will get a memory access violation.
If you want to change a text you must use the array form of declaration.
/Per W
On Wed, 17 Sep 2003, Esteban Valverde wrote:
> Hi, the next code has an running error, non a compiler error. Anybody can
> understand it ?
>
> thanks, Esteban
>
>
> char str1[] = "Hello, how ";
> char *str2 = "are you ?";
>
> char *pstr[2];
>
> // these works fine...
> pstr[0] = str1;
> pstr[1] = str2;
>
> // these works fine...
> printf("%s%s\n", pstr[0], pstr[1]);
>
> // these works fine...
> if(*pstr[0] == 'H')
> printf("\"%s\" start with 'H'\n", pstr[0]);
>
> if(*pstr[1] != 'x')
> printf("\"%s\" don't start with 'X'\n", pstr[1]);
>
> // I'm attempting to increment 'H' to 'I'.
> // these works fine...
> (*pstr[0])++;
> printf("%s\n", pstr[0]);
>
> // I'm attempting to increment 'a' to 'b'.
> // these, doesn't works fine...
> // these halts the computer... the same with (*(pstr[1]))++
> (*pstr[1])++;
> printf("%s\n", pstr[1]);
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: <or...@vp...> - 2003-09-17 19:47:17
|
Esteban Valverde wrote:
> Hi, the next code has an running error, non a compiler error. Anybody can
> understand it ?
> char str1[] = "Hello, how ";
> char *str2 = "are you ?";
>
> char *pstr[2];
...
> // I'm attempting to increment 'a' to 'b'.
> // these, doesn't works fine...
> // these halts the computer... the same with (*(pstr[1]))++
> (*pstr[1])++;
> printf("%s\n", pstr[1]);
str2 is a pointer. It points to a constant string: "are you ?"
Constant strings are NOT allowed to be changed, as they are hard coded
into the exe. So the problem lies here, and not in any sort of
dereferencing. However, in the first case, the thing is different, as
you have an array (str1), not a pointer, and you initialise this array
with a string.
Try this, and it will work:
char str3[] = "are you ?";
char str2 = str3;
I hope this helped.
--
Greetings,
Balázs
|
|
From: Per W. <pw...@ia...> - 2003-09-17 19:24:54
|
Note that when you declare a text string as
char *str2 = "sldfksf"
str2 is only a pointer to a text. Most compilers will place the text in
read-only memory, i.e. if you try to follow the pointer to change the
text, you will get a memory access violation.
If you want to change a text you must use the array form of declaration.
/Per W
On Wed, 17 Sep 2003, Esteban Valverde wrote:
> Hi, the next code has an running error, non a compiler error. Anybody can
> understand it ?
>
> thanks, Esteban
>
>
> char str1[] = "Hello, how ";
> char *str2 = "are you ?";
>
> char *pstr[2];
>
> // these works fine...
> pstr[0] = str1;
> pstr[1] = str2;
>
> // these works fine...
> printf("%s%s\n", pstr[0], pstr[1]);
>
> // these works fine...
> if(*pstr[0] == 'H')
> printf("\"%s\" start with 'H'\n", pstr[0]);
>
> if(*pstr[1] != 'x')
> printf("\"%s\" don't start with 'X'\n", pstr[1]);
>
> // I'm attempting to increment 'H' to 'I'.
> // these works fine...
> (*pstr[0])++;
> printf("%s\n", pstr[0]);
>
> // I'm attempting to increment 'a' to 'b'.
> // these, doesn't works fine...
> // these halts the computer... the same with (*(pstr[1]))++
> (*pstr[1])++;
> printf("%s\n", pstr[1]);
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Per W. <pw...@ia...> - 2003-09-17 19:21:56
|
No, I didn't say it is forbidden to allocate memory in the individual
threads. It's just that you must make sure that the RTL is multi-thread
safe.
Correct me someone, but for MinGW you have to specify -mthreads to the
linker when you build the project.
new/malloc/calloc are not the only RTL functions that may fail in a
multithreaded app. The random generator, and a number of date/time
functions etc are using static variables and buffers and may because of
that fail spectacularly.
If you build on an environment when the compiler can't supply a
thread-safe RTL, then you must manually protect any calls to RTL functions
that might use static state information.
/Per W
On Wed, 17 Sep 2003, Ed Cottrell wrote:
> Per,
>
> It seems like that's probably the root of my problem... This is my first
> multi-threaded app in a language without a garbage collector / built-in
> memory management (like Java).
>
> So, does this mean I need to allocate all memory for the threads from within
> the main thread? For example, one of the thread-level variables for each
> thread is a memory buffer of 50k for batching SQL statements. If I
> understand you, then, I need to allocate that memory from the main thread
> and only let one thread access it. Is that what you're saying?
>
> -Ed
>
> P.S. How would I do the memory locking you describe, under Win32? I'm plenty
> familiar with the concept, but don't know how to implement it in C.
>
>
> -----Original Message-----
> From: Per Westermark [mailto:pw...@ia...]
> Sent: Wednesday, September 17, 2003 1:48 PM
> To: Ed Cottrell
> Cc: dev...@li...
> Subject: Re: [Dev-C++] Multi-Threading locks up
>
>
> I think you have a problem with shared memory. While each new thread shares
> the same memory space with the parent, they should - must - not access the
> same memory at the same time.
>
> 1 - are you linking with a thread-safe RTL, i.e. if the threads allocates
> memory new/malloc/calloc will break if not thread-safe. The same goes for
> the calls to open the connection to the database.
>
> 2 - All memory used in the threads should either be on the stack,
> dynamically allocated or indexed into an array - one entry for each thread.
>
> 3 - If you have to access the same global variable from the different
> threads, or for a child thread and the main thread, you have to protect the
> access with a critical section, mutex, spinlock or similar to assert
> serialized access.
>
> /Per W
>
> On Wed, 17 Sep 2003, Ed Cottrell wrote:
>
> > Hi,
> >
> > I'm working on a multi-threaded database app, which connects to
> > multiple databases and does data-mining. The main thread (which
> > includes the Win32
> > GUI) launches off a user-specified number of threads (say, 10), which then
> > do the actually database queries.
> >
> > I've hit a weird snag, though. As written, the threads all start
> > properly, but then pause themselves, immediately, or almost
> > immediately (after updating 0 to maybe 500 records, out of several
> > hundred thousand). The problem isn't on the database server end; it
> > works fine, but reports that the threads have stopped running queries.
> > Pseudo-code:
> >
> > ...
> > int i, MyThreads=10;
> > for(i = 0; i < MyThreads; i++)
> > {
> > //Splits up the work, here, into MyThreads chunks
> > _beginthread( [the arguments] )
> > }
> > ...
> >
> > This is where it gets weird... IF I create a message box first, the
> > threads start properly AND run until finished! Pseudo-code:
> >
> > ...
> > int i, MyThreads=10;
> > char mymsg[10]
> > for(i = 0; i < MyThreads; i++)
> > {
> > //Splits up the work, here, into MyThreads chunks
> > _beginthread( [the arguments] )
> > sprintf(mymsg, "%d", i);
> > MessageBox(0, mymsg, mymsg, MB_OK);
> > }
> > ...
> >
> > The ONLY difference is in whether or not I show a message box. Anybody
> > know what that's about? Thanks a million!
> >
> > -Ed
> >
> >
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Esteban V. <est...@ho...> - 2003-09-17 19:16:51
|
Hi, the next code has an running error, non a compiler error. Anybody can
understand it ?
thanks, Esteban
char str1[] = "Hello, how ";
char *str2 = "are you ?";
char *pstr[2];
// these works fine...
pstr[0] = str1;
pstr[1] = str2;
// these works fine...
printf("%s%s\n", pstr[0], pstr[1]);
// these works fine...
if(*pstr[0] == 'H')
printf("\"%s\" start with 'H'\n", pstr[0]);
if(*pstr[1] != 'x')
printf("\"%s\" don't start with 'X'\n", pstr[1]);
// I'm attempting to increment 'H' to 'I'.
// these works fine...
(*pstr[0])++;
printf("%s\n", pstr[0]);
// I'm attempting to increment 'a' to 'b'.
// these, doesn't works fine...
// these halts the computer... the same with (*(pstr[1]))++
(*pstr[1])++;
printf("%s\n", pstr[1]);
|
|
From: Ed C. <em...@to...> - 2003-09-17 18:28:48
|
Per,
It seems like that's probably the root of my problem... This is my first
multi-threaded app in a language without a garbage collector / built-in
memory management (like Java).=20
So, does this mean I need to allocate all memory for the threads from =
within
the main thread? For example, one of the thread-level variables for each
thread is a memory buffer of 50k for batching SQL statements. If I
understand you, then, I need to allocate that memory from the main =
thread
and only let one thread access it. Is that what you're saying?
-Ed
P.S. How would I do the memory locking you describe, under Win32? I'm =
plenty
familiar with the concept, but don't know how to implement it in C.
=09
-----Original Message-----
From: Per Westermark [mailto:pw...@ia...]=20
Sent: Wednesday, September 17, 2003 1:48 PM
To: Ed Cottrell
Cc: dev...@li...
Subject: Re: [Dev-C++] Multi-Threading locks up
I think you have a problem with shared memory. While each new thread =
shares
the same memory space with the parent, they should - must - not access =
the
same memory at the same time.
1 - are you linking with a thread-safe RTL, i.e. if the threads =
allocates
memory new/malloc/calloc will break if not thread-safe. The same goes =
for
the calls to open the connection to the database.
2 - All memory used in the threads should either be on the stack,
dynamically allocated or indexed into an array - one entry for each =
thread.
3 - If you have to access the same global variable from the different
threads, or for a child thread and the main thread, you have to protect =
the
access with a critical section, mutex, spinlock or similar to assert
serialized access.
/Per W
On Wed, 17 Sep 2003, Ed Cottrell wrote:
> Hi,
>
> I'm working on a multi-threaded database app, which connects to=20
> multiple databases and does data-mining. The main thread (which=20
> includes the Win32
> GUI) launches off a user-specified number of threads (say, 10), which =
then
> do the actually database queries.
>
> I've hit a weird snag, though. As written, the threads all start=20
> properly, but then pause themselves, immediately, or almost=20
> immediately (after updating 0 to maybe 500 records, out of several=20
> hundred thousand). The problem isn't on the database server end; it=20
> works fine, but reports that the threads have stopped running queries. =
> Pseudo-code:
>
> ...
> int i, MyThreads=3D10;
> for(i =3D 0; i < MyThreads; i++)
> {
> //Splits up the work, here, into MyThreads chunks
> _beginthread( [the arguments] )
> }
> ...
>
> This is where it gets weird... IF I create a message box first, the=20
> threads start properly AND run until finished! Pseudo-code:
>
> ...
> int i, MyThreads=3D10;
> char mymsg[10]
> for(i =3D 0; i < MyThreads; i++)
> {
> //Splits up the work, here, into MyThreads chunks
> _beginthread( [the arguments] )
> sprintf(mymsg, "%d", i);
> MessageBox(0, mymsg, mymsg, MB_OK);
> }
> ...
>
> The ONLY difference is in whether or not I show a message box. Anybody =
> know what that's about? Thanks a million!
>
> -Ed
>
>
|
|
From: Per W. <pw...@ia...> - 2003-09-17 17:48:56
|
I think you have a problem with shared memory. While each new thread
shares the same memory space with the parent, they should - must - not
access the same memory at the same time.
1 - are you linking with a thread-safe RTL, i.e. if the threads allocates
memory new/malloc/calloc will break if not thread-safe. The same goes for
the calls to open the connection to the database.
2 - All memory used in the threads should either be on the stack,
dynamically allocated or indexed into an array - one entry for each
thread.
3 - If you have to access the same global variable from the different
threads, or for a child thread and the main thread, you have to protect
the access with a critical section, mutex, spinlock or similar to assert
serialized access.
/Per W
On Wed, 17 Sep 2003, Ed Cottrell wrote:
> Hi,
>
> I'm working on a multi-threaded database app, which connects to multiple
> databases and does data-mining. The main thread (which includes the Win32
> GUI) launches off a user-specified number of threads (say, 10), which then
> do the actually database queries.
>
> I've hit a weird snag, though. As written, the threads all start properly,
> but then pause themselves, immediately, or almost immediately (after
> updating 0 to maybe 500 records, out of several hundred thousand). The
> problem isn't on the database server end; it works fine, but reports that
> the threads have stopped running queries. Pseudo-code:
>
> ...
> int i, MyThreads=10;
> for(i = 0; i < MyThreads; i++)
> {
> //Splits up the work, here, into MyThreads chunks
> _beginthread( [the arguments] )
> }
> ...
>
> This is where it gets weird... IF I create a message box first, the threads
> start properly AND run until finished! Pseudo-code:
>
> ...
> int i, MyThreads=10;
> char mymsg[10]
> for(i = 0; i < MyThreads; i++)
> {
> //Splits up the work, here, into MyThreads chunks
> _beginthread( [the arguments] )
> sprintf(mymsg, "%d", i);
> MessageBox(0, mymsg, mymsg, MB_OK);
> }
> ...
>
> The ONLY difference is in whether or not I show a message box. Anybody know
> what that's about? Thanks a million!
>
> -Ed
>
>
|
|
From: Vale G. <val...@at...> - 2003-09-17 16:59:05
|
Ravi - > I would like to know how to set up breakpoints in C++ programs for debugging, I am using the Insight Debugger... I'm glad that you got it working. > ...and what it does is set up a breakpoint in the first statement in the main() function and i do not know how to disable this. Go into File > Target Settings and uncheck the box next to "Set breakpoint at main." The easiest way to set a breakpoint is with a mouse click on the hyphen at the left edge of the source code line where you want to stop. To remove a breakpoint, click on the red box which replaced the hyphen on the source code line. You can modify breakpoints by Viewing the breakpoint window (Control+B or View > Breakpoints). There is additional information at Help > Help Topics. This latest version of Insight has fewer bugs than previous versions although you might notice a display anomaly when changing the settings of the memory window. Chuck |
|
From: Santiago P. C. <San...@yd...> - 2003-09-17 16:39:46
|
Hi Ed,
Talking about the scenario where you show a MessageBox, in this situation=
=20an interval time is created between the launching of each thread, so p=
lease...
- check that each thread has not finished before you press the OK button.=
..
- (if the previous thread is still running) check the execution point whe=
re the previous thread is at when the next thread starts...
- check that the threads are not using static variables for temporary val=
ues or loops...
It seems there is a problem with the concurrent execution of your threads=
=20(when they run simultaneously), please check that they behave without =
problems...
Hope this helps!
Regards,
~Santy
-----Original Message-----
From: dev...@li... [mailto:dev-cpp-users-adm=
in...@li...] On Behalf Of Ed Cottrell
Sent: mi=E9rcoles, 17 de septiembre de 2003 17:59
To: dev...@li...
Subject: [Dev-C++] Multi-Threading locks up
Hi,
I'm working on a multi-threaded database app, which connects to multiple =
databases and does data-mining. The main thread (which includes the Win32=
=20GUI) launches off a user-specified number of threads (say, 10), which =
then do the actually database queries.=20
I've hit a weird snag, though. As written, the threads all start properly=
, but then pause themselves, immediately, or almost immediately (after up=
dating 0 to maybe 500 records, out of several hundred thousand). The prob=
lem isn't on the database server end; it works fine, but reports that the=
=20threads have stopped running queries. Pseudo-code:
...
int i, MyThreads=3D10;
for(i =3D 0; i < MyThreads; i++)
=20 {
=20 //Splits up the work, here, into MyThreads chunks
=20 _beginthread( [the arguments] )
=20 }
...
This is where it gets weird... IF I create a message box first, the threa=
ds start properly AND run until finished! Pseudo-code:=20
...
int i, MyThreads=3D10;
char mymsg[10]
for(i =3D 0; i < MyThreads; i++)
=20 {=20
=20 //Splits up the work, here, into MyThreads chunks
=20 _beginthread( [the arguments] )=20
=20 sprintf(mymsg, "%d", i);
=20 MessageBox(0, mymsg, mymsg, MB_OK);
=20 }=20
...
The ONLY difference is in whether or not I show a message box. Anybody kn=
ow what that's about? Thanks a million!
-Ed
-------------------------------------------------------------------------=
-------------
This message and any files transmitted with it are confidential and inten=
ded solely=20
for the use of the individual or entity to whom they are addressed. No co=
nfidentiality=20
or privilege is waived or lost by any wrong transmission.=20
If you have received this message in error, please immediately destroy it=
=20and kindly=20
notify the sender by reply email.
You must not, directly or indirectly, use, disclose, distribute, print, o=
r copy any=20
part of this message if you are not the intended recipient. Opinions, con=
clusions and=20
other information in this message that do not relate to the official busi=
ness of=20
Ydilo Advanced Voice Solutions, S.A. shall be understood as neither given=
=20nor endorsed by it.=20
-------------------------------------------------------------------------=
-------------
|
|
From: Ed C. <em...@to...> - 2003-09-17 16:01:26
|
Hi,
I'm working on a multi-threaded database app, which connects to multiple
databases and does data-mining. The main thread (which includes the Win32
GUI) launches off a user-specified number of threads (say, 10), which then
do the actually database queries.
I've hit a weird snag, though. As written, the threads all start properly,
but then pause themselves, immediately, or almost immediately (after
updating 0 to maybe 500 records, out of several hundred thousand). The
problem isn't on the database server end; it works fine, but reports that
the threads have stopped running queries. Pseudo-code:
...
int i, MyThreads=10;
for(i = 0; i < MyThreads; i++)
{
//Splits up the work, here, into MyThreads chunks
_beginthread( [the arguments] )
}
...
This is where it gets weird... IF I create a message box first, the threads
start properly AND run until finished! Pseudo-code:
...
int i, MyThreads=10;
char mymsg[10]
for(i = 0; i < MyThreads; i++)
{
//Splits up the work, here, into MyThreads chunks
_beginthread( [the arguments] )
sprintf(mymsg, "%d", i);
MessageBox(0, mymsg, mymsg, MB_OK);
}
...
The ONLY difference is in whether or not I show a message box. Anybody know
what that's about? Thanks a million!
-Ed
|
|
From: P.D. v. Z. <pa...@my...> - 2003-09-17 11:49:07
|
Hi, It depends on what OS you want it to work on. For Windows you can use the Win32 API functions FindFirstFile/FindNextFile/FindClose for example. I believe Boost also has a library for enumerating files and directories (www.boost.org) ... not sure though. I couldn't say anything about other platforms though, never had to enumerate files/directories on those (yet) :) Oh, and as for an example... this should do the trick on Win32 (off the top of my head, didn't check the specifics of the API calls, nor did I test the code): WIN32_FIND_DATA wfd; HANDLE hFind = FindFirstFile("*.*", &wfd); if (hFind == INVALID_HANDLE_VALUE) return; do { MessageBox(NULL, wfd.cFileName, "Found file or directory", MB_ICONINFORMATION); } while (FindNextFile(hFind, &wfd)); FindClose(hFind); Hope this helped :) Paul -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Neszt Tibor Sent: Wednesday, September 17, 2003 11:50 AM To: dev...@li... Subject: [Dev-C++] list files in a directory Hello! Where can I find information about listing files? (C/C++ example) Regards, Neszt Tibor ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Neszt T. <ne...@ss...> - 2003-09-17 09:52:25
|
Hello! Where can I find information about listing files? (C/C++ example) Regards, Neszt Tibor |
|
From: Ravi D. <rav...@ho...> - 2003-09-17 08:45:34
|
I would like to know how to set up breakpoints in C++ programs for debugging, I am using the Insight Debugger and what it does is set up a breakpoint in the first statement in the main() function and i do not know how to disable this. Also, I would like to thank Vale Group for his previous help. Keeping my fingers crossed, Ravster. _________________________________________________________________ Fast, faster, fastest: Upgrade to Cable or DSL today! https://broadband.msn.com |