Question about Windows API and C/C++ run-time library function -
when write c/c++ code windows platform, use windows apis necessary. when comes multi-threading, read following quotaion < windows via c/c++ >
the createthread function windows function creates thread. however, if writing c/c++ code, should never call createthread. instead, should use microsoft c++ run-time library function _beginthreadex. if not use microsoft's c++ compiler, compiler vendor have own alternative cratethread. whatever alternative is, must use it.
afaik, language run-time library platform implemented platform's apis. think totally possible call createthread() c/c++ code. , quite did that. don't understand why above rule should followed.
many insights.
of course it's possible use windows api's createthread
directly.
but leaves runtime library uninformed new thread.
for multi-threading support in runtime library (and includes functions rely on static storage, e.g. imagine includes strtok
) need keep runtime library informed, , not informed, partially in charge e.g. failure allocate whatever resources needs thread, results in thread creation failure.
cheers & hth.,
Comments
Post a Comment