网站首页  词典首页

请输入您要查询的函数:

 

术语 createfiberex
释义 CreateFiberEx
语法:
C++
LPVOID WINAPI CreateFiberEx(
__in SIZE_T dwStackCommitSize,
__in SIZE_T dwStackReserveSize,
__in DWORD dwFlags,
__in LPFIBER_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter
);
CreateFiberEx功能
光纤分配对象,分配一个堆栈,并建立集,开始执行在指定的起始地址,通常是纤维的功能。此函数不时间表纤维。
参数
dwStackCommitSize [in]
在最初提交的堆栈字节大小。如果此参数为0,新的纤维使用默认的承诺堆栈可执行文件的大小。有关更多信息,请参见线程堆栈大小。
dwStackReserveSize [in]
堆栈以字节为单位,初步储备规模。如果此参数为0,新的纤维使用默认保留堆栈可执行文件的大小。有关更多信息,请参见线程堆栈大小。
dwFlags [in]
如果此参数为0,浮点在x86系统的状态是不交换和数据可以损坏如果使用的光纤浮点运算。如果这个参数是FIBER_FLAG_FLOAT_SWITCH,浮点状态的光纤开关。
Windows XP和Windows 2000 SP4的:在FIBER_FLAG_FLOAT_SWITCH标志不支持。
lpStartAddress [in]
该申请的指针定义的函数被执行的纤维和代表了纤维的起始地址。新创建的纤维不会开始执行,直到另一个纤维调用该地址的SwitchToFiber功能。更多关于光纤回调函数的详细信息,请参阅FiberProc。
lpParameter [中,可选]
一个变量传递到纤维的指针。该纤维可以检索使用GetFiberData宏观数据。
返回值
如果函数成功,返回值是光纤的地址。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
该纤维可以创建一个进程的数目有限的可用虚拟内存。默认情况下,每对光纤有1兆字节预留堆栈空间。因此,您可以创建最多2028纤维。如果您降低默认的堆栈大小,可以创造更多的纤维。但是,您的应用程序将有更好的表现,如果您使用的处理请求替代战略。
前一个线程可以安排使用SwitchToFiber纤维的功能,它必须调用ConvertThreadToFiber职能,以便有与线程相关联的纤维。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0400或更高版本。有关详细信息,请参阅使用Windows头。
要求:
最低支持clientWindows带有SP4 XP中,Windows 2000专业版
最低支持serverWindows带有SP4 Server 2003中,Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
ConvertThreadToFiber
FiberProc
纤维
GetFiberData
进程和线程函数
SwitchToFiber
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==CreateFiberEx Function
Allocates a fiber object, assigns it a stack, and sets up execution to begin at the specified start address, typically the fiber function. This function does not schedule the fiber.
Syntax
C++
LPVOID WINAPI CreateFiberEx(
__in SIZE_T dwStackCommitSize,
__in SIZE_T dwStackReserveSize,
__in DWORD dwFlags,
__in LPFIBER_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter
);
Parameters
dwStackCommitSize [in]
The initial commit size of the stack, in bytes. If this parameter is zero, the new fiber uses the default commit stack size for the executable. For more information, see Thread Stack Size .
dwStackReserveSize [in]
The initial reserve size of the stack, in bytes. If this parameter is zero, the new fiber uses the default reserved stack size for the executable. For more information, see Thread Stack Size.
dwFlags [in]
If this parameter is zero, the floating-point state on x86 systems is not switched and data can be corrupted if a fiber uses floating-point arithmetic. If this parameter is FIBER_FLAG_FLOAT_SWITCH, the floating-point state is switched for the fiber.
Windows XP and Windows 2000 with SP4: The FIBER_FLAG_FLOAT_SWITCH flag is not supported.
lpStartAddress [in]
A pointer to the application-defined function to be executed by the fiber and represents the starting address of the fiber. Execution of the newly created fiber does not begin until another fiber calls the SwitchToFiber function with this address. For more information on the fiber callback function, see FiberProc .
lpParameter [in, optional]
A pointer to a variable that is passed to the fiber. The fiber can retrieve this data by using the GetFiberData macro.
Return Value
If the function succeeds, the return value is the address of the fiber.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
The number of fibers a process can create is limited by the available virtual memory. By default, every fiber has 1 megabyte of reserved stack space. Therefore, you can create at most 2028 fibers. If you reduce the default stack size, you can create more fibers. However, your application will have better performance if you use an alternate strategy for processing requests.
Before a thread can schedule a fiber using the SwitchToFiber function, it must call the ConvertThreadToFiber function so there is a fiber associated with the thread.
To compile an application that uses this function, define _WIN32_WINNT as 0x0400 or later. For more information, see Using the Windows Headers .
Requirements
Minimum supported clientWindows XP, Windows 2000 Professional with SP4
Minimum supported serverWindows Server 2003, Windows 2000 Server with SP4
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
ConvertThreadToFiber
FiberProc
Fibers
GetFiberData
Process and Thread Functions
SwitchToFiber
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682406(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:21:23