|
The .NET Framework allows more than one managed thread (i.e. a Thread created through the .NET Framework), referred to here as a Logical Thread, to run on top of an operating system thread created by CreateThread , referred to here as a Physical Thread.
I'm not sure that the CLR itself does this when self-hosting, but the possibility is allowed so that a hosting environment such as SQL Server can perform its own user-mode scheduling (when processing a query, and a thread would have to block to wait for data to arrive from disk, SQL Server switches that thread to processing a different query).
|
|
|
|
|
First of all I will like to Thank You for answering my question.
Now the difference is clear between Physical and Logical Threads.But further one question that popped in my mind as soon as I read your reply is at core level it is the responsibility of the OS to create Threads and schedule threads and processes
And if CLR generates logical threads by itself on the top
of threads created by OS is it not like interfering with the normal OS functionality.
Vikas M Pai
Software Engineer.
|
|
|
|
|
what string function or any expression that returns the first letter of each word in uppercase, all other letters in lowercase in reporting services?
thank you in advance
jyn
|
|
|
|
|
You may feel dirty after doing this, but you can import the Microsoft.VisualBasic namespace and use StrConv function with the VbStrConv.ProperCase option.
Don't tell anyone I told you.
|
|
|
|
|
ok!
thank you!
jyn
|
|
|
|
|
Brady Kelly wrote: You may feel dirty after doing this, but you can import the Microsoft.VisualBasic namespace and use StrConv function with the VbStrConv.ProperCase option.
Don't tell anyone I told you.
Since you did not remove the message in time, it will remain here forever...
|
|
|
|
|
It's OK, I didn't use a VB6 function myself. When I started with C# though, I was sooo tempted to import Microsoft.VisualBasic just for IsNumeric...
|
|
|
|
|
Hello,
I've made a user control that i host in my website in Internet Explorer. It works, sort of, but it doesn't have all the needed permissions (WebPermission in particular).
When i try to play a sound that has to be downloaded from a url from my website, i get this:
Microsoft .NET framework
Application attempted to perform an operation not allowed by the security police. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework configuration tool.
Request for the permission of type 'System.Net.WebPermission, ...' failed
The action that failed was: Demand
The type of the first permission that failed was: System.Net.WebPermission
at System.Media.SoundPLayer.LoadSync()
at System.Media.SoundPLayer.LoadAndPlay(Int32 flags)
at System.Media.SoundPLayer.Play()
at ...
I've made a code group with the Microsoft .Net 2.0 Administration tool, in which i gave all assemblies with my strong name public key Full Trust. If i evaluate the assembly loaded from the url, it also states that my assembly has Full Trust permissions. Setting it to Everything or SkipVerification permission does'nt work, and only makes it worse (sometimes my control won't even load in IE then). I also tried to make a code group based on the url, but that didn't work either.
The weird thing is, my control uses a WebService and that works fine, but that is using web access too rigth? So why does downloading a file from the same website not work?
Does anyone know how to solve this?
|
|
|
|
|
Hi,
I want to call Path.GetFiles(string Path, string searchPattern, SearchOption searchOption) to retrive all image files in a particular directory. I am having trouble creating a searchPattern string that will do this. Is it possible to search for multiple file types using this method, or will I have to search for all files then check the extensions? I have already tried the following:
string searchString = "*.bmp,*.jpg";
string searchString = "*.bmp;*.jpg";
string searchString = "*.bmp *.jpg";
string searchString = "*.bmp|*.jpg";
Regards
SamM
|
|
|
|
|
The search pattern will only accept as single pattern, like "*.bmp". You have to call GetFiles repeatedly, once for each file extension you want.
|
|
|
|
|
|
I have the following signature for my Insert on a custom class:
public iCustomException Insert(Person Person)
{
iCustomException oCE = null;
CommitOutcome oCO = Person.Commit(Person.Current_Src_UID, Person.Current_Src_ID, ref oCE);
return oCE;
}
My question is there a way to retrieve the return value of this function call through the ObjectDataSOurce either by Parameters or some other way? The returned object is a class that derives from Exception and tells me if there was an error during the call and what the specifics are about the error.
Any help is greatly appreciated
Regards, Santiago "Saint" Perez Florida's Turnpike Enterprise - Santiago.perez@dot.state.fl.us
|
|
|
|
|
I haven't actually tried it, but I am pretty sure you can add a Parameter to the InsertMethod and then just set the Direction to returnvalue. The only thing I am not sure about is if it will allow your custom type. Normally, you are forced to use simple types.
Hope that helps.
Ben
|
|
|
|
|
I am using C# and wish to create a project on VS 2005 and using the framework of .net 1.0 please help
samuel
|
|
|
|
|
You can't. To target .NET Framework 1.0, you must use Visual Studio .NET 2002 or the .NET Framework 1.0 SDK (using the command-line csc compiler).
VS2005 can only target .NET Framework 2.0, .NET Compact Framework 1.0 (if the desktop .NET Framework 1.1 is installed) and .NET Compact Framework 2.0.
|
|
|
|
|
Please don't cross post.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You can't like Mike said. If you develop a project on VS2005, then anyone using it would have to be running .Net 2.0 which is better than 1.0 anyways.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
You can use MSBEE to target 1.1 on Visual Studio 2005:
http://www.google.co.uk/search?hl=en&q=msbee&meta=[^]
BUT this will not change the intellisense or any of the other handy things in the IDE from 2.0 1.1 so you'll have to know from memory what you can and cannot use.
You should use 2.0 anyway ... it has some extreamly useful new stuff in it.
|
|
|
|
|
How many copies of the Common Language Runtime (CLR) can be executing on a machine at one time?
I think there is only one image of the CLR running on a machine. It will try to load mscoree.dll into memmory only only if it is not there. it is not in a per application basis. am i right ???
|
|
|
|
|
The CLR is loaded once per process, normally, as the Windows Process is the primary runtime host. However, it may be loaded fewer or more times in someone's custom build runtime host.
|
|
|
|
|
An unlimited number, or one, depending on what you're talking about.
There can be multiple versions of the .NET Framework CLR installed on a computer. There is however only one copy of mscoree.dll (per processor architecture), which is installed in the Windows System32 folder (on a 64-bit system, the 32-bit x86 version is in SysWOW64). This is really a stub responsible for loading the correct version of the real runtime (either mscorwks.dll or, for server GC on .NET 1.x, mscorsvr.dll).
Each process can only have one version of the CLR loaded (right now, this is 1.0.3705, 1.1.4322, or 2.0.50727). The first version requested is the only one ever loaded in that process. Unless otherwise guided by an application config file, .NET DLLs loaded via COM Interop will cause the latest version of the CLR installed on the system to be loaded into that process. 64-bit processes can only load v2.0 of the CLR because .NET 1.x doesn't support 64-bit.
Now we get into how Windows loads code and (initialised) data from program binaries (EXEs and DLLs). It actually loads them as shared (memory-mapped files) - the code and data are initially only in physical memory once. It also loads them on-demand - only when actually referenced, so loading a 5MB DLL doesn't immediately consume 5MB of physical memory. Writeable data pages are marked copy-on-write - they start out sharing the same data, but as soon as the process tries to write to the page, the OS makes a copy of it.
Read-only and unchanged copy-on-write pages can be re-read from the original file, so when trying to free up physical memory, Windows can simply discard the page, rather than having to write it out to the page file. The page is said to be backed by the original file. Pages that have been written to, and dynamically-allocated pages, are backed by the page file.
DLLs (and EXEs) have a base address. This is the virtual memory address, in the process's address space, that it would like to load at. Being the first thing to be loaded, the EXE always loads at its base address, but DLLs might have to be moved - relocated - elsewhere if there's something else already at that address (whether another DLL or some other allocation). Some native processor instructions only work with absolute addresses, which are written into the program code and data. When relocating a DLL, the OS has to change these addresses, so it copies the original page to a new page (backed by the page file) and modifies that.
So ideally, there's only one copy of read-only code and data from any EXE or DLL in physical memory at any one time, but there might be more if a DLL had to be relocated.
That's how it works for EXEs and DLLs containing native code. For managed, .NET code, Windows still loads the EXEs and DLLs as above, but the CLR must compile the IL code contained in the file into native code that the processor can actually execute. It does this by allocating memory in the process's address space which is unique to that process. Each process has its own copy of JIT-compiled code.
This would normally result in a lot of duplicated pages, hence physical memory overhead, so the Framework has the ability to pre-JIT compile whole assemblies and store them as native code on the disk, using the ngen program. It then loads these as regular native code DLLs, allowing Windows to do its normal sharing of these DLLs' pages between processes, as well as saving time since the JIT compiler step is not required. Large parts of the Framework are pre-JITted in this way. You can see the list (of 32-bit native assemblies generated by .NET 2.0) by going to Windows\Assembly\NativeImages_v2.0.50727_32 in a command prompt and getting a directory listing.
When it has loaded a native image, or JITted the code, the Framework still needs the original assembly for a few things (like Reflection and JITting other methods which refer to the assembly), but in general the original pages containing IL are not referenced that often, so Windows will eventually discard them.
|
|
|
|
|
very interesting summary. I would like to be able to vote 6 or more.
Even though, just maybe, the OP expected a more concise yes or no.
Regards
|
|
|
|
|
Thanks Mike, Thanks a lot for that elaborated reply which helped me to clear my doubt. and i've voted 5
|
|
|
|
|
i need to create a setup file for a database project in vb.net that will create a database and also install a server when the setup file will be installed.and that program will be run in any other computer which have no vb.net or sql server.
that means sql server and .net framework and database will be installed by the setup file execution like any other software.
please help me.
|
|
|
|
|
Have you done a search for articles here on CP? If I recall, there may be one or two...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|