.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_CreateThreadWithStackSize: .\" https://wiki.libsdl.org/SDL_CreateThreadWithStackSize .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_CreateThreadWithStackSize .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_CreateThreadWithStackSize 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_CreateThreadWithStackSize \- Create a new thread with a specific stack size\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "SDL_Thread * SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data); .fi .SH DESCRIPTION SDL makes an attempt to report .BR name to the system, so that debuggers can display it\[char46] Not all platforms support this\[char46] Thread naming is a little complicated: Most systems have very small limits for the string length (Haiku has 32 bytes, Linux currently has 16, Visual C++ 6\[char46]0 has _nine_!), and possibly other arbitrary rules\[char46] You'll have to see what happens with your system's debugger\[char46] The name should be UTF-8 (but using the naming limits of C identifiers is a better bet)\[char46] There are no requirements for thread naming conventions, so long as the string is null-terminated UTF-8, but these guidelines are helpful in choosing a name: https://stackoverflow\[char46]com/questions/149932/naming-conventions-for-threads If a system imposes requirements, SDL will try to munge the string for it (truncate, etc), but the original string contents will be available from .BR SDL_GetThreadName ()\[char46] The size (in bytes) of the new stack can be specified\[char46] Zero means "use the system default" which might be wildly different between platforms\[char46] x86 Linux generally defaults to eight megabytes, an embedded device might be a few kilobytes instead\[char46] You generally need to specify a stack that is a multiple of the system's page size (in many cases, this is 4 kilobytes, but check your system documentation)\[char46] .SH FUNCTION PARAMETERS .TP .I fn the .BR SDL_ThreadFunction function to call in the new thread .TP .I name the name of the thread .TP .I stacksize the size, in bytes, to allocate for the new thread stack\[char46] .TP .I data a pointer that is passed to .BR fn .SH RETURN VALUE Returns an opaque pointer to the new thread object on success, NULL if the new thread could not be created; call .BR SDL_GetError () for more information\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_CreateThread (3), .BR SDL_WaitThread (3)