the mutex in db_iterator.c protects now less statements. This results in the global variable buffer being a problem, since each thread accesses it concurrently. Need to find a nice way to have each thread write in its own memory. Either without globals or with threadlocal globals