How do you name MySQL threaded queries?
#12

OK, a clarification. When you call "Callback_Get" (which is called within the mysql_inline_query function (or whatever it is called - you know what I mean)), it stores the address of the function and all the local variables at the current time. When the callback is invoked, all the locals are restored. If you create two queries, two copies of the locals are stored. This copy of the locals is called a "closure".

The two are totally separate. You could make many queries in a loop, and when each one was called the loop variable would be whatever it was at query time. So 10 queries in a loop, 10 different future values of "i".

This is also why "Callback_Release" is required (but again, I think that is handled internally in the mysql include), to free up the memory used by the closure.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)