Search code examples
devexpressxpo

sharing XPObject object between threads


I am evaluating XPO, so far so good, really like it.

I have a background thread do monitoring a directory, when it find a new file is added it parse the file name, and store this object to datastore and then fire an event with the object as arg, and i handle this event on ui thread through invoke, and on UI thread i need change the state of the XPObject, how can i do this to make sure thread safe? fire an event with Oid of the XPObject? and on UI thread try to grab the object from db and process on it, this seems a little stupid design if have million objects.

Any suggestion?


Solution

  • The most correct solution is to pass Oids of the required objects to the UI thread and process them separately.