I've been working on some backend code that will run on Windows, Linux, and MAC boxes. This wasn't at all a problem in Lazarus until I realized that I had to have some DB synchronization built into the application (some versions of SQLite aren't thread-safe).
Of course I've read Martin Harvey's lessons on threading multiple times (had to when I converted them to go live) and am quite familiar with writing MREWS (basic one at http://www.eonclash.com/Tutorials/Mu...y1.1/Ch11.html would work here).
Looking into it, there isn't really a good implementation (cross platform) of Semaphores (TSemaphore in some Linux versions, Pipes in MAC, API in Windows) within Lazarus. I don't actually need cross process communications, so I'm thinking of writing a simple spin lock based MREWS that supports an operation stack (Finish existing reads, start write, queue reads/writes, finish write, process queue). Just want to make sure that something like this doesn't already exist before I re-invent this particular wheel.
Once complete, I'll post up for everyone of course
- Jeremy
Bookmarks