Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8969853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:39:06+00:00 2026-06-15T17:39:06+00:00

I am using Quartz.net in mono. When I create a scheduler like this: ISchedulerFactory

  • 0

I am using Quartz.net in mono.
When I create a scheduler like this:

ISchedulerFactory quartzSchedulerFactory = new StdSchedulerFactory();
IScheduler quartzScheduler = quartzSchedulerFactory.GetScheduler();

in Quartz.Net, in the class SimpleThreadPool the following method is called:

/// <summary>
/// Called by the QuartzScheduler before the <see cref="ThreadPool" /> is
/// used, in order to give the it a chance to Initialize.
/// </summary>
public virtual void Initialize()
{
    if (workers != null && workers.Count > 0) 
    {
        // already initialized...
        return;
    }

    if (count <= 0)
    {
        throw new SchedulerConfigException("Thread count must be > 0");
    }

    // create the worker threads and start them
    foreach (WorkerThread wt in CreateWorkerThreads(count))
    {
        wt.Start();

        availWorkers.AddLast(wt);
    }
}

In Windows this works fine, but in CentOS the system freezes when wt.Start() is called. Even if I kill the process it becomes defunct and only restarting the system can kill it.
Although sometimes it works, about one in 5 times I execute the program.

Here is the code called when the WorkerThread starts:

public override void Run()
{
    bool ran = false;
    bool shouldRun;
    lock (this)
    {
        shouldRun = run;
    }

    while (shouldRun)
    {
        try
        {
            lock (this)
            {
                while (runnable == null && run)
                {
                    Monitor.Wait(this, 500);
                }

                if (runnable != null)
                {
                    ran = true;
                    runnable.Run();
                }
            }
        }
        catch (Exception exceptionInRunnable)
        {
            log.Error("Error while executing the Runnable: ", exceptionInRunnable);
        }
        finally
        {
            lock (this)
            {
                runnable = null;
            }
            // repair the thread in case the runnable mucked it up...
            if (Priority != tp.ThreadPriority)
            {
                Priority = tp.ThreadPriority;
            }

            if (runOnce)
            {
                lock (this)
                {
                    run = false;
                }
                tp.ClearFromBusyWorkersList(this);
            }
            else if (ran)
            {
                ran = false;
                tp.MakeAvailable(this);
            }
        }

        // read value of run within synchronized block to be 
        // sure of its value
        lock (this)
        {
            shouldRun = run;
        }
    }

    log.Debug("WorkerThread is shut down");
}

Could it be a deadlock problem? And if it is, why doesn’t it happen in windows?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:39:06+00:00Added an answer on June 15, 2026 at 5:39 pm

    I had the similar issue in the CentOs. Mono 2.10.8.1 was stuck at creating default threadpool threads. After the stuck it was impossible to kill the process or get the stacktrace.

    I’ve managed to fix the problem by updating the core of the OS.
    From 2.6.32-71.el6.x86_64 up to 2.6.32-279.14.1.el6.x86_64.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Quartz.NET it seems like I need to name every job I create. Is
This is probably a simple question, but I am pretty new to using Quartz.NET,
it is a interesting question. i am using Quartz.net to make job scheduler. also
I am using Quartz.NET, and my scheduler relies heavily on the use of cron
I'm trying to build a simple scheduler using Quartz.NET, but when I try to
I'm trying to create a job in an ASP.NET (C#) form using Quartz.NET, and
I am using Quartz.Net to schedule task. I have tried like wise. Started a
Sorry for another non programming question, but I'm using Quartz.NET, a scheduler for .NET
I'm using Quartz.NET scheduler as a stand-alone windows service while from an ASP.NET app
I'm using Quartz.NET in a Windows Service I am creating, and I'd like a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.