c# - Does BackgroundWorker guarantee that memory changes made on the background thread become visible to the main thread? -



c# - Does BackgroundWorker guarantee that memory changes made on the background thread become visible to the main thread? -

if utilize backgroundworker modify info structures in application, there guarantee changes made on background thread visible main (ui) thread when backgroundworker completes (e.g. within runworkercompleted event handler)? bonus points: if so, mechanism guarantees this?

no, there no such guarantee. you'll need synchronize access shared memory if want access multiple threads.

of course of study if utilize bgw built in mechanisms passing info between threads, such through result or progress info stores, synchronize access data.

c# backgroundworker memory-visibility

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -