[help]About wxFileConfig multi process read and write problem Topic is solved
[help]About wxFileConfig multi process read and write problem
wxFileConfig can R-W the file Ini.
but
At the same time there are multiple processes to read and write the same Ini file will be wrong
How to solve this problem? Help!
but
At the same time there are multiple processes to read and write the same Ini file will be wrong
How to solve this problem? Help!
Re: [help]About wxFileConfig multi process read and write problem
I guess you're using wxFileConfig for something it wasn't designed for. wxFileConfig just isn't thread-safe. If you really want to use it, you'd have to write a wrapper around it that protects all methods with a mutex.
Use the source, Luke!
Re: [help]About wxFileConfig multi process read and write problem
doublemax wrote:I guess you're using wxFileConfig for something it wasn't designed for. wxFileConfig just isn't thread-safe. If you really want to use it, you'd have to write a wrapper around it that protects all methods with a mutex.
Yes, may be I must do it.
I thought wxfileconfig was thread-safe
Later encountered a problem before they know it is not
thinks
Re: [help]About wxFileConfig multi process read and write problem
doublemax wrote:I guess you're using wxFileConfig for something it wasn't designed for. wxFileConfig just isn't thread-safe. If you really want to use it, you'd have to write a wrapper around it that protects all methods with a mutex.
dear doublemax
Give me a suggestion that I want to use the security configuration file, which will be better with wxWidgets, In addition to the registry
Re: [help]About wxFileConfig multi process read and write problem
I misread your original question, i thought you were talking about multiple threads, but now i realize you were talking about multiple processes.
This makes the problem even more difficult and the easiest solution that comes to mind would be a sqlite database (with wxSQLite3) that's shared among all processes.
https://sqlite.org/faq.html#q5
This makes the problem even more difficult and the easiest solution that comes to mind would be a sqlite database (with wxSQLite3) that's shared among all processes.
https://sqlite.org/faq.html#q5
Use the source, Luke!
Re: [help]About wxFileConfig multi process read and write problem
doublemax wrote:I misread your original question, i thought you were talking about multiple threads, but now i realize you were talking about multiple processes.
This makes the problem even more difficult and the easiest solution that comes to mind would be a sqlite database (with wxSQLite3) that's shared among all processes.
https://sqlite.org/faq.html#q5
thanks very mush
Re: [help]About wxFileConfig multi process read and write problem
doublemaxdoublemax wrote:I misread your original question, i thought you were talking about multiple threads, but now i realize you were talking about multiple processes.
This makes the problem even more difficult and the easiest solution that comes to mind would be a sqlite database (with wxSQLite3) that's shared among all processes.
https://sqlite.org/faq.html#q5
In addition to wxSQLite3
How can we use WX to complete it?
Re: [help]About wxFileConfig multi process read and write problem
Sorry, i don't understand the question. What more do you need?How can we use WX to complete it?
Use the source, Luke!
Re: [help]About wxFileConfig multi process read and write problem
I would like to see whether the wxWidgets package has a similar CreateMutex API.doublemax wrote:Sorry, i don't understand the question. What more do you need?How can we use WX to complete it?
Or there is no relevant class to achieve process security
Re: [help]About wxFileConfig multi process read and write problem
Are we still talking about the problem of shared file access? In that case, you don't have to do anything, sqlite does it internally. Just use the same database file (locally or over a network share) from all applications and all will be able to read/write to it.I would like to see whether the wxWidgets package has a similar CreateMutex API.
Or there is no relevant class to achieve process security
Use the source, Luke!
Re: [help]About wxFileConfig multi process read and write problem
doublemax wrote:Are we still talking about the problem of shared file access? In that case, you don't have to do anything, sqlite does it internally. Just use the same database file (locally or over a network share) from all applications and all will be able to read/write to it.I would like to see whether the wxWidgets package has a similar CreateMutex API.
Or there is no relevant class to achieve process security
Yes, it's better to use SQLite
The use of the API platform is also a problem
Well, it's worth it, even if it's going to make it bigger
thanks