Hi,
Thanks in advanced.
May I ask a question here?
In a continuation's hanlder, take the code piece below for example,
HostDBContinuation::dnsEvent {
...
EThread *thread = mutex->thread_holding; // here
MUTEX_TRY_LOCK_FOR(lock, action.mutex, thread, action.continuation);
...
}
Why do we use mutex->thread_holding rather than this_ethread()?
Is it due to the performance reason? pthread_getspecific is slow?
I googled a lot, seems in x86/x64 Linux, there isn't too much cost. it just
implemented with some special register, i.e. GS/FS.
So, what's the reason?
Thanks again,
Xin