Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a fiber cookie?

I was browsing through the .NET Marshall class, when I noticed the method GetThreadFromFiberCookie. I tried searching for the term, but only found references to Fibers in the context of threading on Windows. So what is a fiber cookie?

like image 854
Simon Verbeke Avatar asked Nov 11 '22 01:11

Simon Verbeke


1 Answers

According to: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.getthreadfromfibercookie%28v=vs.100%29.aspx

"Fiber cookies are opaque tokens that are used by the host when alerting the common language runtime to its fiber-scheduling decisions. They consist of a stack and register context."

"A fiber is a particularly lightweight thread of execution...They use co-operative multitasking" - http://en.wikipedia.org/wiki/Fiber_%28computer_science%29

like image 83
Daniel Samson Avatar answered Nov 15 '22 11:11

Daniel Samson