Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Oct 1998 16:44:55 +0000
From:      Tony Finch <dot@dotat.at>
To:        freebsd-current@FreeBSD.ORG
Subject:   Re: Thread Scheduler bug
Message-ID:  <E0zYvBv-0001OS-00@fanf.noc.demon.net>
In-Reply-To: <199810290942.EAA21626@highwind.com>

next in thread | previous in thread | raw e-mail | index | archive | help
HighWind Software Information <info@highwind.com> wrote:
>
>I'm worried about the thread scheduler. Here is a disturbing test
>program out for folks to try.
>
>As you can probably guess, we are now battling the scheduler because
>some of our application's threads are getting seriously starved by
>other threads.

We've been having what seem to be related problems. We're currently
running Squid on a number of 2.2 boxen, but we're keen to move to 3.0
because of the potential performace improvement that asynchronous IO
can provide -- normal Squid tends to get IO bound, and the threaded
async-io version could fix that. Unfortunately libc_r doesn't seem up
to the task :-(

The problematic code is the async-io initialisation:

[...]
    pthread_attr_init(&globattr);
    pthread_attr_setscope(&globattr, PTHREAD_SCOPE_SYSTEM);
    globsched.sched_priority = 1;
    main_thread = pthread_self();
    pthread_setschedparam(main_thread, SCHED_OTHER, &globsched);
    globsched.sched_priority = 2;
    pthread_attr_setschedparam(&globattr, &globsched);

    /* Create threads and get them to sit in their wait loop */
[...]

This won't compile owing to the lack of some of the scheduling
functions, and if you try simply taking them out (as has been
suggested in the past on freebsd-questions) then Squid fails to start
because it cannot communicate with the dnsserver child processes. This
seems to indicate a scheduling problem of some sort. Squid doesn't
make any sort of yield calls; would this cause such problems?

What is the status of the kernel threads project? It occurs to me that
some of the other new functionality of 3.0 is quite similar to that
used by the linuxthreads implementation -- rfork() is quite similar to
Linux's clone(); does the POSIX.1b stuff help for thread scheduling?

Tony.
-- 
fanf@demon.net	dot@dotat.at

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0zYvBv-0001OS-00>