PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

EdgeLib theadsafe?

ChezDoodles · 21 Apr 2006, 08:07 UTC
I take it for granted - but just to be sure:

Is EdgeLib theadsafe?

ALL of EdgeLib - including compression engines, memory allocs, file / directory api's, etc?

What about EdgeClass (with ECD members) - is it threadsafe and re-entrant when calling from other threads than the main thread?
As far as we know, Edge is capable of running in a threaded environment.

In our games, we use audio class Hekkus (which uses its own thread) and uses memory allocated by Edge.

I must add that Edge hasn't been tested thoroughly with multiple threads.

Could you tell me more on how you would use Edge in a multithreaded environment?
ChezDoodles · 21 Apr 2006, 09:03 UTC
Primary use of threading:

1) Loading screens...
Load resources in the background while either a) running an animated loading screen, or b) while user still are configuring the game.

2) Initialization...
start initialization of resource manager, network manager, sound mananger simultanously and start the welcome screen, and even the first menu...
Then, when the network manager becomes available after a while, I would like to spinn off a CheckForUpdates thread in the background as well as a CheckForNews thread...
Also, I would like to start a BluetoothListenThread and a BluetoothSearch thread to automatically search for other players...enabling menu options as they are discovered...

3) Already mentioned, but I would like to do Bluetooth search and discovery in the background as well.

It's all about giving the user a fast fix and a smooth ride - doing things in the background...

I know you don't HAVE to use threads to do these kind of things.... but it is more easy to do with threads, and this is why threads were invented, so why not use them?
Those are good examples.

Most network events are currently being handled asynchroniously, except searching for Bluetooth devices on Windows devices (even when it's an asynchronal function call). It is possible to search for Bluetooth devices in the background on Symbian devices though.

We're interested to see if everything will go well when using multiple threads. Let us know how it goes.