>>>>> "Sasha" == Sasha Pachev <sasha@stripped> writes:
>> You can use a global handle as long as you ensure that no other thread
>> calls access the handle until you have called mysql_store_result().
Sasha> So does than mean that you can do something like this:
Sasha> MYSQL dbh;
Sasha> mysql_connect(&dbh, "localhost", "scott", "tiger");
Sasha> case -1: scream_bloody_murder_and_die("Cannot fork");
Sasha> case 0: mysql_query(&dbh, "insert into test values
Sasha> (1,'hello1'); break;
Sasha> default: mysql_query(&dbh, "insert into test values
Sasha> (2,'hello2'); break;
No; fork() will not work(). If you use pthread_create() instead of
fork it will work().
(fork() will inherit file descriptors which isn't that nice in this context)