From owner-freebsd-current Wed Jan 6 12:04:47 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA00626 for freebsd-current-outgoing; Wed, 6 Jan 1999 12:04:47 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from server.noc.demon.net (server.noc.demon.net [193.195.224.4]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA00619 for ; Wed, 6 Jan 1999 12:04:44 -0800 (PST) (envelope-from fanf@demon.net) Received: by server.noc.demon.net; id UAA10328; Wed, 6 Jan 1999 20:04:15 GMT Received: from fanf.noc.demon.net(195.11.55.83) by inside.noc.demon.net via smap (3.2) id xma010306; Wed, 6 Jan 99 20:04:00 GMT Received: from fanf by fanf.noc.demon.net with local (Exim 1.73 #2) id 0zxzBQ-0007Tt-00; Wed, 6 Jan 1999 20:04:00 +0000 To: current@FreeBSD.ORG From: Tony Finch Subject: Squid + linuxthreads in action Message-Id: Date: Wed, 6 Jan 1999 20:04:00 +0000 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG We've been trying out Squid compiled to use async-io with linuxthreads on FreeBSD-current today. It required a bit of fiddling to work around incorrect assumptions in Squid's build and configuration stuff: To CFLAGS I added: -D_THREAD_SAFE -DLINUXTHREADS -I/usr/local/include To XTRA_LIBS I added: -kthread I modified src/aiops.c and src/main.c to test for _SQUID_LINUX_THREADS_ instead of (defined(_SQUID_LINUX_) && USE_ASYNC_IO) and altered include/config.h.in to define _SQUID_LINUX_THREADS_ in the appropriate situations. After running `configure` I had to edit src/Makefile to remove -pthread from LDFLAGS. (It would be better for the long term to alter configure.in and rebuild configure, but...) Squid then compiles and runs OK, apart from a few things: When the parent Squid process shuts down it leaves behind a pile of orphan processes (the async-io handler threads). A glance at the aio code reveals that Squid expects the pthread library to kill them -- they just loop indefinitely. They also keep the listen socket open, so the RunCache script can't restart Squid :-( Also, it crashed hard after several minutes under load. This might have been due to us using softupdates with ccd rather than the threads stuff. Tony. -- f.a.n.finch dot@dotat.at fanf@demon.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message