Threads and String Constants

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by freak.

Hi,

This one goes to Fred, I think...

I know, that the PB String management is not threadsave, but what if I use String Constants in the Threads only? Or what about if I only use fixed Strings directly with the Functions and use no String Variables at all?

Would that be save, or am I still going to get in a mess?

Thanks in advice...

Timo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

it should be safe, as no duplication will be done. But don't use string functions on them, as it will use the internal string buffer...

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by freak.

Thanks, i think, i'm going to avoid using Strings wherever possible and where I have to, i'm going to use GlobalAlloc_() to manage them on my own.

But If I had to replace the Constants with Memory Buffers, too, it would be a lot of work to do.

Timo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Is it possible to read string arrays without problems in threads? or does it make problems too?

Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
System 2: Mobile Pentium 4 2.4GHz 512 MB DDR GeForce4 420-32, Windows XP Home
Post Reply