From: Warren Young Date: March 5 2009 7:32pm Subject: Re: Confirmation about thread un-safety/safety List-Archive: http://lists.mysql.com/plusplus/8440 Message-Id: <49B028B6.9000703@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jim Wallace wrote: > Thanks for the reply. Just to confirm, from reading the link, if I use > store/store_next, I can give the StoreQueryResult to another thread > since the first is finished consuming the results and the entire result > set is in the StoreQueryResult. (Looking at the code, that looks safe > since I'm just calling vector::at()) That sounds right, particularly with v3.0+, where there are fewer hidden links between MySQL++ data structures and the low-level C data structures returned by the MySQL C API library. That said, beware that I'm not writing from experience, since, as you know, I believe threads are evil. I only use them for applications so trivial that they cannot fail. (Not that you asked, but my company's primary product achieves concurrency through message-passing among independent single-threaded processes. Each process uses async I/O to keep it responsive. We don't need no steenking threads.) You might want to download the svn version of MySQL++ and build the user manual. I've just finished reworking the threads chapter and the tutorial section on concurrent queries to clarify several things.