BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

CLR Hosting and Fibers

| by Jonathan Allen Follow 7 Followers on Nov 15, 2006. Estimated reading time: 1 minute |

The CLR can be hosted in a wide variety of environments. Out of the box these include Internet Explorer, IIS, and SQL Server 2005, and developers are free to create their own. Unfortunately, one thing they don't support is fibers.

Developers can create their own CLR host  following Steven Pratschner's directions in MSDN Magazine. This requires knowledge of C++ as well as the .NET framework. The advantage of hosting your own CLR is that you get unparalleled control over the code isolation and security, and even some control over the GC and threading models.

One advantage of the CLR is that it decouples managed threads from the underlying OS threads. This means a managed thread can skip from thread to thread, or if the host supports it, from fiber to fiber. Regretfully, large portions of the WIN32 require thread affinity. Since fibers themselves can jump from thread to thread, tracking thread affinity becomes quite difficult. Even worse, a large portion of the BCL does not even try to account for this.

The end result, according to Joe Duffy, is that fibers are too unstable to be safely implemented at this time. While applications using fibers may appear to work, long-running hosts like SQL Server being these subtle thread-affinity errors to light.

 

 

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Common thoughs about fibers? by Michael Nemtsev

Heh, 2 days before your post I've written about CLR and fibler in my blog laflour.spaces.live.com/blog/cns!7575E2FFC19135...

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT