Do Not Use CreateThread() when Using C-Runtime Functions

Do Not Use CreateThread() when Using C-Runtime Functions

When writing multithreaded applications in the Windows Environment, you have two options for creating new threads: the C-runtime function _beginthread (and _beginthreadex) or the WIN32 API CreateThread(). If the thread is using C-Runtime functions (strcat, fopen, etc), use the beginthread approach. If the thread is created with the WIN32 API CreateThread() and uses C-Runtime functions, there will be a small memory leak when the thread is exiting.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist