for each fiber. If no fiber switching occurs, FLS acts exactly the
same as [ thread local storage ](thread-local-storage) . The FLS functions ( [
**FlsAlloc** ](/en-us/windows/win32/api/fibersapi/nf-fibersapi-flsalloc) , [
**FlsFree** ](/en-us/windows/win32/api/fibersapi/nf-fibersapi-flsfree) , [
**FlsGetValue** ](/en-us/windows/win32/api/fibersapi/nf-fibersapi-flsgetvalue)
, and [ **FlsSetValue** ](/en-us/windows/win32/api/fibersapi/nf-fibersapi-
flssetvalue) ) manipulate the FLS associated with the current thread. If the
thread is executing a fiber and the fiber is switched, the FLS is also
switched.

To clean up the data associated with a fiber, call the [ **DeleteFiber**
](/en-us/windows/desktop/api/WinBase/nf-winbase-deletefiber) function. This
data includes the stack, a subset of the registers, and the fiber data. If the
currently running fiber calls **DeleteFiber** , its thread calls [
**ExitThread** ](/en-us/windows/win32/api/processthreadsapi/nf-
processthreadsapi-exitthread) and terminates. However, if the selected fiber
of a thread is deleted by a fiber running in another thread, the thread with
the deleted fiber is likely to terminate abnormally because the fiber stack
has been freed.

##  Related topics

[ Using Fibers ](using-fibers)

Â

Â

* * *

##  Feedback

Was this page helpful?

Yes  No

[ Provide product feedback  ](https://www.microsoft.com/en-us/windowsinsider/feedbackhub/fb) | 

[ Get help at Microsoft Q&A
](https://learn.microsoft.com/answers/tags/224/windows-api-win32/)

##  Feedback

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the
feedback mechanism for content and replacing it with a new feedback system.
For more information see: [ https://aka.ms/ContentUserFeedback
](https://aka.ms/ContentUserFeedback) .

Submit and view feedback for

[ This product  ](https://www.microsoft.com/en-
us/windowsinsider/feedbackhub/fb) This page

[ View all page feedback  ](https://github.com//issues)

* * *

##  Additional resources

[ California Consumer Privacy Act (CCPA) Opt-Out Icon  Your Privacy Choices
](https://aka.ms/yourcaliforniaprivacychoices)

Theme

  * Light 
  * Dark 
  * High contrast 

  *   * [ Previous Versions ](/en-us/previous-versions/)
  * [ Blog ](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
  * [ Contribute ](/en-us/contribute/)
  * [ Privacy ](https://go.microsoft.com/fwlink/?LinkId=521839)
  * [ Terms of Use ](/en-us/legal/termsofuse)
  * [ Trademarks ](https://www.microsoft.com/legal/intellectualproperty/Trademarks/)
  * © Microsoft 2024 

##  Additional resources

###  In this article

[ California Consumer Privacy Act (CCPA) Opt-Out Icon  Your Privacy Choices
](https://aka.ms/yourcaliforniaprivacychoices)

Theme

  * Light 
  * Dark 
  * High contrast 

  *   * [ Previous Versions ](/en-us/previous-versions/)
  * [ Blog ](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
  * [ Contribute ](/en-us/contribute/)
  * [ Privacy ](https://go.microsoft.com/fwlink/?LinkId=521839)
  * [ Terms of Use ](/en-us/legal/termsofuse)
  * [ Trademarks ](https://www.microsoft.com/legal/intellectualproperty/Trademarks/)
  * © Microsoft 2024