In some cases, unmanaged resources occupy a large amount of memory, while managed resources only occupy a small amount of resources. Therefore, it is difficult for GC to estimate whether garbage collection should be performed on this resource, it is
Generally, use the thread pool whenever possible.
Except for the following four situations:
The thread needs to be manually controlled to run on a non-default priority (not recommended)
It must be displayed as a foreground thread
It takes a
The cost of creating a thread in CLR is relatively high. It requires two parts.
Memory:
Core Thread object, which stores some content and context of the description thread (memory consumption: 700b-2500b)
Thread environment, such as exception
Recently implemented a lockfree Object pool.
The main idea is:
1. Reuse the constructed object2. Avoid GC pressure caused by repeated creation and destruction of objects
3. Avoid resource consumption caused by repeated object Creation
The
APM: the asynchronous programming model (asynchronous programming model) beginxxx
EAP: The Event-base asynchronous pattern (Event-based programming mode) button. Click + = ........EPM: The Event-base programming model
1. In essence, EAP also
C/C ++ and. Net call each other,CodeConversion Tool:
1.Http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/CLRInsideOut2008_01.exe
2. c ++/C # Conversion Tool
Specific conversion code:
Code
Code
This article from http://blog.csdn.net/usernamegaorn/archive/2007/10/20/1834254.aspx
Ado. Net naming rulesData Type abbreviated standard naming exampleConnection con connorthwindCommand cmd cmdreturnproductsParameter parm
Write todayProgramWhen the list set is modified, "the set has been modified; enumeration may not be performed ." Error.
The first thing that comes to mind is that the Set object is not locked.
Added private readonly object syncroot = new object ();
The menu and toolbar are essential for winform interface layout! However, menustrip and toolstrip cannot directly set the border style. If you want to achieve the separation line between the menu and toolbar, it is not easy to implement it. Today, I
This article from the http://www.cnblogs.com/kingfly/archive/2009/09/17/1568179.html below is some common regular expressions, I think it is useful to collect it.
Only numbers are allowed: "^ [0-9] * $ ".Only n digits can be entered: "^ \ D {n} $
This article from http://blog.csdn.net/usernamegaorn/archive/2007/10/20/1834275.aspx
Basic naming rules
Note: Pascal case: the first letter and other letters of all words are in upper case. camel case: except the first word, the first
This article from http://www.codeproject.com/KB/miscctrl/first_control.aspx
A very simple introduction to writing your first. Net Control
Download source files-1 KB
Introduction
This is an extremely simple introduction
Katama hash is often seen in distributed solutions.AlgorithmThere are already manyArticleIntroduce this algorithm or other hash consistency Algorithms
A while ago, when I was working on a distributed system, I needed to implement this algorithm. I
This article is based on the example in C # programming typical instance analysis.
Excel worksheet before merge:
After merging the Excel Worksheet:
The sorting functions are as follows:
Code
Code highlighting produced by
This article from http://www.codeproject.com/KB/miscctrl/signalstrengthcontrol.aspx
Download source-46.13 KB
Introduction
This is a relatively simple control that controls strates some of the techniques used in developing
Habitually hitting the keyboard, checking the server,ProgramCheck that everything seems so harmonious. The rest is data verification. How many pieces of industry data is also a headache for me. No one can tell me that I am not a boss.
Busy for a
Needless to say, postCodeYou can understand it!
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
1
//
Class Name: ecanqq
2
//
Role: QQ adsorption form
3
//
Author: Liu dianwu
The Finalize method is used to reclaim unmanaged resources to prevent resource leakage.
In rare cases, it will also be used to host resources.
1. if an exception is thrown in the constructor, only the Finalize method will be executed. Some
BelowCodeDynamic generation of CS files
Compile as assembly
You can use appdomain. Load to loadProgramSet and new type
Public Static Void Test (){ // Declare the code Codecompileunit compunit = New Codecompileunit
1. Object resurrection
When the GC wants to call the Finalize method of an object
GC will force this object to be in the active state
This object will disappear permanently only after the Finalize method is called.
The main reason is: the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service