Variables getting wrong value

Just starting out? Need help? Post your questions and find answers here.
phuckstepp
User
User
Posts: 19
Joined: Tue Dec 27, 2005 12:10 pm
Location: United Kingdom
Contact:

Variables getting wrong value

Post by phuckstepp »

I have an application I'm writing that uses multiple threads. The thread when active processes a set folder and adds information in a listIconGadget.

I have a timer that counts down and then calls a procedure that processes the items in the list that the thread has added to it.

In this procedure consists of a loop that takes the first row from the list, processes it and then removes it. Once all items have been processed the procedure quits.

However, when I use:

dataToProcess$ = GetGadgetItemText(#gadget_processlist,0,0)

The value that is put in the variable is not correct and seems to be from an entirelly different gadget elsewhere in the application. If I print the variable and the getGadget to the debug window both values are different. The value printed directly from the gadget is correct, the variable is not.


Does anyone know what and why this is happening. I can't find any logical explaination for it. I thought it might have been a threading thing but even with the threads stopped it still does it. The procedure is also causing an 'Invalid memory access' error, but again I'm not sure why.

I can't post the procedure code at the mo because I'm at work but any suggestions and help would be appreciated.


My System:
Windows XP Pro x64 Edition
2Gb RAM
GeForce 6800GT 256Mb

I've also tested on a 32Bit Windows XP Pro as well with the same results.
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Post by Dr. Dri »

the string library is not thread-safe
should be fixed in the 4 version

Dri ;)
phuckstepp
User
User
Posts: 19
Joined: Tue Dec 27, 2005 12:10 pm
Location: United Kingdom
Contact:

Post by phuckstepp »

Hmm, thats what I thought. Any ideas when we can expect v4? There seems to be posts back from 2004 about it.
Steve Elliott
Enthusiast
Enthusiast
Posts: 109
Joined: Sun Jan 01, 2006 9:34 pm
Location: Wales, UK

Post by Steve Elliott »

When will v4 be available? Asked the same question myself - see Henrik's reply:

viewtopic.php?t=18451
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

when it's done... probably monday
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Post by Bonne_den_kule »

...or next month I guess.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

didn't say *which* monday :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
phuckstepp
User
User
Posts: 19
Joined: Tue Dec 27, 2005 12:10 pm
Location: United Kingdom
Contact:

Post by phuckstepp »

guess I'll have to wait for v4's release then.

Thanks.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

you could use mutex stuff if necessary, or critical section coding...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply