.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Can I invoke a sleeping thread by name which is running inside the same process

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net

I have an web application in which Application start event I have started some thread.In those threade one thread name is "JobManagerThread" which is quering the database after each 2 minutes and if found some record then do proccessing otherwise sleeps.

Now From one of my page i wanted to trigger that Thread [that is if it is sleeping then i wanted it to start]

can it be possible?

I am working with .net framework 3.5

View Complete Post

More Related Resource Links

CLR Inside Out: In-Process Side-by-Side


The new .NET Framework 4.0 maintains backward compatibility while allowing core innovations by using a new feature called In-Process Side-by-Side. Learn about how it works and some problems it didn't solve.

Luiz Fernando Santos, Jesse Kaplan

MSDN Magazine December 2009

CLR Inside Out: Thread Management In The CLR


Getting the performance you want in concurrent applications is not as straightforward as you might think. See how common threading issues can affect your application.

Erika Fuentes and Eric Eilebrecht

MSDN Magazine December 2008

Detect if code is running inside SQL Server.

Can managed code "detect" if it is running in the normal .Net CLR or the special SQL Server CLR? Is there some environment flag or field we can look at at runtime? Thanks Cap'n  

The application domain in which the thread was running has been unloaded

Recently upgraded to VS 2005. With a large project, I keep getting this message when I try and build.Looked through the forums - have tried cleaning and rebuilding - no joy.Have also tried increasing size of virtual memory - no joy.Any ideas?Thanks   

Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection

Hello All, Suddenly, the sql server is down, in the log file, C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG, I found the record as follows, 2007-03-05 15:40:31.59 Logon       Error: 17189, Severity: 16, State: 1.2007-03-05 15:40:31.59 Logon       SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems. [CLIENT:] What else I can do to further investigate? Thanks Spencer

How to process just one cube in a solution of three cubes inside BIDS SSAS

Hi, I have a BIDS Solution with three cubes...I want to make a full process of just one of the cubes, but If am doing just one, the other cubes comes unavailable... How can I process just one without affecting the other ones? Thanks!

Help with running external Process from button click

We need assistance with a portion of a major web application project scheduled to begin user testing within 10 days.  The troublesome part of the code calls an external application when a button is clicked in Web page.  When run from a command prompt or bat file, the external application, App.exe, runs perfectly producing the desired result.  We created a test page and a small console application, Con.exe, to test the button code with a known quantity.  The test application runs perfectly when the button in the Web page is clicked.  However when we change the code to run App.exe instead of Con.exe, the App.exe code will not execute.  We even tried creating a bat file to execute App.exe.  Like the exe, the bat file executes from the command prompt or when double-clicked, but fails to run when called as a process from the button click event.  Can anyone assist us?  Here is the C# code: (.Net 3.5 sp1) using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Diagnostics;   namespace WebButtonTest {     public partial class _Default : System.Web.UI.Page  &nbs

how to see how many thread are running in app.domain?

hello   in my wpf application i need to see if there are threds running before running a new one   is there a simple way to see how many thread are running in the application?    

Process 65:0:1 (0x1b28) Worker 0x3DCD00E8 appears to be non-yielding on Scheduler 5. Thread creation



I have a 6GB database, and i have set a backup job on daily basis. problem is this i am getting some errors in sql error log when the backup job starts. the error as bellow.


The error not occurs daily its recorded after 3 or 4 days.


2008-08-13 19:01:17.62 Server      Using 'dbghelp.dll' version '4.0.5'
2008-08-13 19:01:17.64 Server      ***Unable to get thread context - no pss
2008-08-13 19:01:17.64 Server      * *******************************************************************************
2008-08-13 19:01:17.64 Server      *
2008-08-13 19:01:17.64 Server      * BEGIN STACK DUMP:
2008-08-13 19:01:17.64 Server      *   08/13/08 19:01:17 spid 0
2008-08-13 19:01:17.64 Server      *
2008-08-13 19:01:17.64 Server      * Non-yielding Scheduler
2008-08-13 19:01:17.64 Server      *
2008-08-13 19:01:17.64 Server      * *******************************************************************************
2008-08-13 19:01:17.64 Server      Stack Signature for the dump is 0x0000003A
Process 65:0:1 (0x1b28) Worker 0x3DCD00E8 appears to be non-yielding on Scheduler 5. Thread creation time: 12863135631614. Approx Thread CPU Used: kernel 531 ms, user 93 ms. Process Utilization 0%. System Idle 98%. Interval: 70002 ms.

When i start a process and running an external program is there any way to set the program window po


  private void View_Log_File_Click(object sender, EventArgs e)

            if (processNotePad == null || processNotePad.HasExited)
                processNotePad = System.Diagnostics.Process.Start("notepad.exe", "\"" + path_exe + "\\log\\logger.txt\"");


The problem is after the program the process started and i see the program when i click somewhere on the form1 the main application window the window of the process program is moving

"The agent process was stopped while the test was running."


I have a solution that was originally created using VS 2008. I have quite a few unit tests that all passed when ran in VS 2008.

Yesterday I opened this solution in VS 2010 and converted it using the wizard. The solution built just fine, it runs just fine, BUT now all tests that access the db fail. I get the same error on every test (below).

"The runtime has encountered a fatal error. The address of the error was at 0x5b3b5ad7, on thread 0x19a4. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack."

In test classes that use ClassInitialize() and ClassCleanup() methods, all the tests fail. All tests fail with the same error, "The agent process was stopped while the test was running."  Tests in test classes that do not utilize ClassInitialize() and ClassCleanup() (these tests do not hit the database) all pass.

When this was a VS2008 project all 153 tests passed. No changes have been made to these tests, other than converting the project to a VS2010 project.

I've been playing around with one test class. I commented out the ClassInitialize() and ClassCleanup() methods. I rewrote one test me

about architecture of SQL Server Cursors and inside SQL server cursors process mechanism


Hi all,

I need some information about architecture of SQL Server Cursors and inside mechanism of SQL Server Cursors,

My Information

·         IM using SQL SERVER 2005 and 2008



Error running Document Aprpoval Process application sample


Hi all,

I download and install the application samples for Windows Workflow Foundation 4 on my machine. When I try to run the Document Approval Process example the ApprovalManager project runs fine but when I start the ApprovalClient.exe I run into problems. Can anybody help?

My environment is: Windows 7 64-bit with VS2010. The only change I have made is that the Express Db's name is '(local)' instead of 'localhost\SQLExpress' and I have changed this in the App.Config file.

Thanks in advance for your help.


Here is the error files:


<?xml version="1.0" encoding="UTF-16"?>
    <MATCHING_FILE NAME="ApprovalClient.exe" SIZE="36864" CHECKSUM="0xA99D9EE4" BIN_FILE_VERSION="1.0.3971.16290" BIN_PRODUCT_VERSION="1.0.3971.16290" PRODUCT_VERSION="1.0.3971.16290" FILE_DESCRIPTION="Microsoft.Samples.DocumentApprovalProcess.ApprovalClient" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Windows Communication Foundation and Windows Workflow Foundation SDK" FILE_VERSION="1.0.3971.16290" ORIGINAL_FILENAME="ApprovalClient.exe" INT

How can you invoke a Workflow from within a running WorkflowApplication?


Our app has this concept of being able to "embed" workflows inside other workflows.  So, we have a custom activity called EmbedWF.  In the EmbedWF's execute handler, we are essentially loading the XAML workflow definition of a particular workflow ... and then we need to invoke it, or run it. 

The parent workflow is hosted in a WorkflowApplication instance ... it uses persistance, navigation, etc.  The idea is that when it executes and comes to an instance of an EmbedWF activity, we want to then kick off that other embedded workflow. 

Is there a good way to do this? 

I've tried this (from the Execute event of the EmbedWF activity):

          WorkflowInvoker wfi = new WorkflowInvoker(activity);
          IDictionary<string, object> resultArgs = wfi.Invoke(args);


But that's just causing the workflow application to hang when it's running UI activities.  I've also tried this:


Running external 32 process from 64 bit OS


I am using System.Diagnostics.Process.Start() to run an external program.

I am seeking to find the best method to handle running an extrnal 32 bit application from my C# project whether it is being used on a 32 or 64 bit platform.

The path to the the external program is configured centrally for all workstations. So at the moment when I invoke the Process.Start("C:\Program Files\MyProgram\MyProgram.exe"), it works when invoked from a 32 bit OS, but not on a 64 bit.

I know I could programatically detect the OS type and alter the file path accordingly, however I thought that there was a method where this was handle automatically.

i.e. When "C:\Program Files\MyProgram\MyProgram.exe" is invoked on 64 bit OS, the system will know to execute it from "C:\Program Files\MyProgram (x86)" instead.


Control.Invoke must be used to interact with controls created on a separate thread.


I am making a stock taking application in a smart device projec tin Visual Studio 2010. What i want to do is create a thread for when i want to update the database(csv file) and use a status control to show the user what is happening ("connecting", "saved", "error") etc.


However when i try to call a function from within my save method whcih is running on a thread i get a Control.Invoke must be used to interact with controls created on a separate thread error at runtime.

    private void btnUpdateStock_Click(object sender, EventArgs e)
      if (this.txtStock.ReadOnly == false && notSaving)
        Product p = dataManager.getCurrentProduct();
        p.unitsInStock = Int32.Parse(this.txtStock.Text);

        Thread saveThread = new Thread(new ThreadStart(saveItems));


    public void saveItems()

Running process with non admin rights



I have created an UPDATE application  that basically update my acutal application.

My actual application has one executable and one windows service. Till now my Actual application and update application was working under users of administrative group. But now customer is mentioning that all users should be from users group not administrators group.

My application is already deployed to various remote locations . But now my update application is failing since first step of my application is to stop the windows service. Since now users are logged in with user account i am not able to stop the service.

Please recommend some solution in this scenerio




S H1


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend