A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.wikipedia.org/wiki/Beginthread below:

Beginthread - Wikipedia

From Wikipedia, the free encyclopedia

The beginthread function creates a new thread of execution within the current process. It is part of the Microsoft Windows runtime library and is declared in the process.h header file.

unsigned long _beginthread(void(* Func)(void*), unsigned Stack_size, void *Arg);

Thread execution starts at the beginning of the function func. To terminate the thread correctly, func must call _endthread or end with "return 0", freeing memory allocated by the run time library to support the thread.

The operating system allocates a stack for the thread containing the number of bytes specified by stack_size. If the value of stack_size is zero, the operating system creates a stack the same size as that of the main thread.[1]

The operating system passes Arg to Func when execution begins. Arg can be any 32-bit value cast to void*.

Returns the operating system handle of the newly created thread. If unsuccessful, the function returns −1 and sets errno.

To compile a program using multiple threads with the Microsoft C/C++ Compiler, you must specify the /MT switch (or /MTd, for debug programs).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4