DR,
Your example only holds up if you are using unsafe code. To create an
array on the stack, you have to use unsafe code in C#. Otherwise, you have
a reference on the stack, and the array is created on the heap.
For unsafe code, and for creating new threads, you have to set the
assembly to unsafe in sql server when registering it.
All that aside, SQL Server will manage the memory and the threads. The
CLR is hosted by SQL Server, and defers to SQL Server for threads and
memory, so how those resources are going to be allocated is going to be
dependent on SQL Servers settings (how much memory are you allowing SQL
Server to use? Is it using threads, or fibers? etc, etc).
Basically, SQL Server is the master of it's domain when it comes to the
CLR. The CLR will not do anything that SQL server will not allow it to do.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"DR" <so*******************@yahoo.comwrote in message
news:uw**************@TK2MSFTNGP03.phx.gbl...
what are the memory caps for threads running as a CLR stored procedure
executed by sql server 2005? is it limited by OS only or also by sql
servers memory limits? e.g. lets say my clr stored procedure is executed
by sql server 2005 then it creates 10 threads and each thread builds a
giant array on the stack, is the limits of each array limited by sql
server or the os? do these clr stored procedures run inside the sql server
address space or does sql server fork a sepperat process for each one?