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
Post a Comment