Bank.Lock() Overhead?

BlitzMax Forums/BlitzMax Programming/Bank.Lock() Overhead?

Leiden(Posted 2006) [#1]
Just wondering if using Lock/UnLock on a Bank in a loop is going to create any overhead? Should I use MemAlloc instead?

Cheers.


Dreamora(Posted 2006) [#2]
If you don't need it, never lock something within a loop (this holds for images as for banks - similar as it already has been in old blitz with buffers), as it will always become far slower if you lock - unlock within the loop.

But the "best way" depends on the actual use you need it for.


Leiden(Posted 2006) [#3]
Is it ok to leave a Bank locked for the duration of a loop as long as you are not changing its data? I.E Just leave it locked for the program, and unlock it once you need to modify its data.