正在加载图片...
Threads in MS Windows(Cont) A program can call beginthreado to create a new thread to execute a specified function. Then the program and the newly created thread are executed concurrently unsigned long beginthread( void(* Func )(void *), unsigned stack size, void arglist) The lst parameter: start address of the function to be executed The 2nd parameter: stack size for the new thread: 0 for system default The 3rd parameter: pointer to a list of parameters to be passed to the function NULL for no parameter Two remarks: <process. h> must be included 2. The application must link with one of the multithreaded C run-time libraries E using the "/MT option of cl. exe command 55 Threads in MS Windows (Cont.) • A program can call _beginthread() to create a new thread to execute a specified function. Then the program and the newly created thread are executed concurrently. unsigned long _beginthread( void(* Func )(void *), unsigned stack_size, void *arglist ); The 1st parameter: start address of the function to be executed The 2nd parameter: stack size for the new thread; 0 for system default The 3rd parameter: pointer to a list of parameters to be passed to the function; NULL for no parameter Two remarks: 1. <process.h> must be included 2. The application must link with one of the multithreaded C run-time libraries. E.g., using the “/MT” option of cl.exe command
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有