c++ - MFC and threads. Skip Document/View and make my own solution? -


i rewriting mfc application make threadsafe. application not use document/view pattern , data not handled consistently. in gui, in structs, in xml.

so want handle data in consistent, threadsafe way. if have data in 1 struct easy lock when needed.

so ok skip whole document/view model , separate data , presentation in own way?

the application work this:

a communication stack run in 1 thread, when message received lock data , necessary changes it. send message main thread tell gui needs updated. gui lock data , read it, change gui.

simple answer yes, it's ok that. can custom-write own presentation completely, literally down pixel if want. doing lock->data access->unlock->paint seems wise; depending on access time, might able paint inside lock well, or update dib in lock painting outside of lock... have lots of options...


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -