• Performance counter

            <p>
            Performance counter is used to monitor the running status of an application. The application itself just output the performance data. The data itself don't need to be calcuated by the application, the data is used by external application, like performance MMC. Here discussed how to output performance data only. To output performance data takes several steps.
            </p>
    
  • Output a tempalte to file

            <p>
            You can output the result of a template to file system but use the command line and the  code smith project file. The default behavior is that code smith engine, call the template's GetFileName method, and output the result to a text file with that file name. CodeTemplate also has a method RenderToFile(fileName). This method is not to be called inside the template itself, because it will fall into infinitive loop, because itself will call Render method. RenderToFile(fileName) is to be called by external client. But the fileName logic should be maintained inside the template. So we can create the follow the code to implement our requirement.
            </p>
    
  • Call External Method

            <p>In a workflow, to call the external method, you need the following ready.</p>
            <ul>
            <li>The workflow need a interface marked with ExternalDataExchange. In the callExternalMethodActivity node, you need to configure the InterfaceType, MethodName, MethodInvoking, and what value to be used as passed-in parameter.
            </li>
    
  • Monitor and lock

            <p>Below is sample code about how to use Monitor. </p>
    
  • Thread Interrupt vs Abort

            <p>Both methods can terminate a thread.  The difference is that they raise difference exception, interrupt can use goto to save its life, abort can not use goto to save its life, and abort can pass some information into the running thread by calling Abort(object stateInfo). The running thread can access this object by ThreadAbortException.ExceptionState .
            </p>