|
Without seeing more of your code, it's hard to say what else you might do for this. One idea is to have InitClientData() generate the data such that it's already shared so you don't have to do shared_close(). If the thread is not exiting, then you can undef($tmp) to clear the memory it's holding on to. Use a bare 'return;' at the end of your thread subroutine to ensure it's not returning a copy of anything on exit. If your data structure is known and reusable, you could try:
lock($CLIENT_DATA);
# InitClientData will initialize the existing data structure
initClientData( $dbh, $CLIENT_DATA );
|