Revision: 14833
Author: adrian.chadd
Date: Fri Dec 31 03:05:33 2010
Log: Begin fleshing out the beginning of a threading framework.
(There's still -lots- more to go.)
http://code.google.com/p/lusca-cache/source/detail?r=14833
Added:
/playpen/LUSCA_HEAD_threading/libsqthr
/playpen/LUSCA_HEAD_threading/libsqthr/Makefile.am
/playpen/LUSCA_HEAD_threading/libsqthr/thr_core.c
/playpen/LUSCA_HEAD_threading/libsqthr/thr_core.h
Modified:
/playpen/LUSCA_HEAD_threading/Makefile.am
/playpen/LUSCA_HEAD_threading/configure.in
/playpen/LUSCA_HEAD_threading/doc/debug-sections.txt
/playpen/LUSCA_HEAD_threading/src/Makefile.am
=======================================
--- /dev/null
+++ /playpen/LUSCA_HEAD_threading/libsqthr/Makefile.am Fri Dec 31 03:05:33
2010
@@ -0,0 +1,8 @@
+## Process this file with automake to produce Makefile.in
+
+libsqthr_a_SOURCES = \
+ thr_core.c
+
+noinst_LIBRARIES = \
+ libsqthr.a
+
=======================================
--- /dev/null
+++ /playpen/LUSCA_HEAD_threading/libsqthr/thr_core.c Fri Dec 31 03:05:33
2010
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ *
+ * DEBUG: section 88 Thread Core Library
+ *
+ */
+
+#ifndef _REENTRANT
+#error "_REENTRANT MUST be defined to build the squid thread core support."
+#endif
+
+#include "../include/config.h"
+
+#include <pthread.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/uio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <dirent.h>
+#include <signal.h>
+#if HAVE_SCHED_H
+#include <sched.h>
+#endif
+#include <string.h>
+
+/* this is for sqinet.h, which shouldn't be needed in here */
+#include <netinet/in.h>
+#include <sys/socket.h>
+
+#include "../include/util.h"
+#include "../include/Array.h"
+#include "../include/Stack.h"
+
+#include "../libcore/dlink.h"
+#include "../libcore/varargs.h"
+#include "../libcore/tools.h"
+#include "../libcore/gb.h"
+#include "../libcore/kb.h"
+
+#include "../libsqdebug/debug.h"
+
+#include "../libmem/MemPool.h"
+#include "../libmem/MemBufs.h"
+#include "../libmem/MemBuf.h"
+
+/*
+ * This is for comm.h, which includes stuff that should be in the
filedescriptor
+ * related code. Sigh. That should be fixed.
+ */
+#include "../libsqinet/sqinet.h"
+
+#include "../libiapp/fd_types.h"
+#include "../libiapp/comm_types.h"
+#include "../libiapp/iapp_ssl.h"
+#include "../libiapp/comm.h"
+#include "../libiapp/disk.h"
+
+#include "thr_core.h"
+
=======================================
--- /dev/null
+++ /playpen/LUSCA_HEAD_threading/libsqthr/thr_core.h Fri Dec 31 03:05:33
2010
@@ -0,0 +1,27 @@
+#ifndef __THR_CORE_H__
+#define __THR_CORE_H__
+
+struct _thr_core_queue_t {
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ dlink_list l;
+ unsigned long requests;
+ unsigned long blocked; /* main failed to lock the queue */
+};
+
+struct _thr_core_thread_t {
+ dlink_node n;
+ pthread_t thread;
+/*
+ squidaio_thread_status status;
+ struct squidaio_request_t *current_req;
+ unsigned long requests;
+*/
+};
+
+struct _thr_core_t {
+ pthread_attr_t globattr;
+ dlink_list thr;
+};
+
+#endif /* __THR_CORE_H__ */
=======================================
--- /playpen/LUSCA_HEAD_threading/Makefile.am Sun Aug 29 00:41:59 2010
+++ /playpen/LUSCA_HEAD_threading/Makefile.am Fri Dec 31 03:05:33 2010
@@ -4,8 +4,8 @@
#
AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects 1.5
-DIST_SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp
libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug
libstmem libasyncio libsqtlv libsqstore snmplib scripts src icons errors
contrib doc helpers tools app test-suite
-SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp
libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug
libstmem libasyncio libsqtlv libsqstore @makesnmplib@ scripts src icons
errors doc helpers tools app test-suite
+DIST_SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp
libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug
libstmem libasyncio libsqtlv libsqstore libsqthr snmplib scripts src icons
errors contrib doc helpers tools app test-suite
+SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp
libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug
libstmem libasyncio libsqtlv libsqstore libsqthr @makesnmplib@ scripts src
icons errors doc helpers tools app test-suite
DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
DEFAULT_PINGER = $(libexecdir)/`echo pinger |
sed '$(transform);s/$$/$(EXEEXT)/'`
=======================================
--- /playpen/LUSCA_HEAD_threading/configure.in Thu Nov 18 22:45:24 2010
+++ /playpen/LUSCA_HEAD_threading/configure.in Fri Dec 31 03:05:33 2010
@@ -3350,6 +3350,7 @@
libcb/Makefile \
libsqname/Makefile \
libstmem/Makefile \
+ libsqthr/Makefile \
lib/Makefile \
scripts/Makefile \
scripts/RunCache \
=======================================
--- /playpen/LUSCA_HEAD_threading/doc/debug-sections.txt Mon Oct 19
00:10:59 2009
+++ /playpen/LUSCA_HEAD_threading/doc/debug-sections.txt Fri Dec 31
03:05:33 2010
@@ -91,3 +91,4 @@
section 85 COSS external helpers
section 86 UFS rebuild helper
section 87 Logging Helper Library
+section 88 Thread Core Library
=======================================
--- /playpen/LUSCA_HEAD_threading/src/Makefile.am Sun May 23 00:33:46 2010
+++ /playpen/LUSCA_HEAD_threading/src/Makefile.am Fri Dec 31 03:05:33 2010
@@ -249,6 +249,7 @@
-L../libasyncio \
-L../libsqtlv \
-L../libsqstore \
+ -L../libsqthr \
@XTRA_OBJS@ \
@REPL_OBJS@ \
@STORE_OBJS@ \
@@ -259,6 +260,7 @@
@LIB_MALLOC@ \
@SSLLIB@ \
@LIB_EPOLL@ \
+ -lsqthr \
-lsqstore \
-lsqtlv \
-lasyncio \
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.