setup
so_locations
stats
+stress
sysdep.h
sysdep.h.in
sysoputil
$Log$
+ Revision 614.83 2004/03/16 19:05:50 error
+ * Further changes to stress.c, Makefile.in to build it, .cvsignore
+ (but it's still broken)
+
Revision 614.82 2004/03/15 18:11:34 error
* stress.c: various fixed/improvements (but it still isn't working)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
EXEEXT=@EXEEXT@
-CLIENT_TARGETS=citadel$(EXEEXT) whobbs$(EXEEXT)
+CLIENT_TARGETS=citadel$(EXEEXT) whobbs$(EXEEXT) stress$(EXEEXT)
SERVER_TARGETS=citserver setup $(CHKPWD)
SERV_MODULES=serv_chat.o \
serv_upgrade.o \
citmail.c citserver.c client_chat.c client_passwords.c \
clientsocket.c commands.c config.c control.c $(DATABASE) \
domain.c serv_extensions.c file_ops.c genstamp.c getutline.c \
- housekeeping.c html.c imap_fetch.c imap_misc.c imap_search.c \
- imap_store.c imap_tools.c internet_addressing.c ipc_c_tcp.c \
- locate_host.c md5.c messages.c \
+ housekeeping.c html.c ical_dezonify.c imap_fetch.c imap_misc.c \
+ imap_search.c imap_store.c imap_tools.c internet_addressing.c \
+ ipc_c_tcp.c locate_host.c md5.c messages.c \
mime_parser.c msgbase.c msgform.c parsedate.c policy.c \
room_ops.c rooms.c routines.c routines2.c \
screen.c sendcommand.c serv_bio.c serv_calendar.c serv_chat.c \
serv_newuser.c serv_pas2.c serv_pop3.c serv_rwho.c serv_smtp.c \
serv_spam.c serv_test.c serv_mrtg.c serv_spam.c serv_upgrade.c \
serv_vandelay.c serv_vcard.c server_main.c setup.c snprintf.c \
- support.c sysdep.c tools.c user_ops.c userlist.c \
- whobbs.c vcard.c ical_dezonify.c
+ stress.c support.c sysdep.c tools.c user_ops.c userlist.c \
+ whobbs.c vcard.c
DEP_FILES=$(SOURCES:.c=.d)
whobbs$(EXEEXT): whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS)
$(CC) whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS) $(LDFLAGS) -o whobbs $(LIBS)
+stress$(EXEEXT): stress.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS)
+ $(CC) stress.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS) $(LDFLAGS) -o stress $(LIBS)
+
sendcommand: sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o $(LIBOBJS)
$(CC) sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o \
$(LIBOBJS) $(LDFLAGS) -o sendcommand $(LIBS)
static volatile int count = 0; /* Total count of messages posted */
static volatile int total = 0; /* Total messages to be posted */
static pthread_mutex_t count_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t arg_mutex = PTHREAD_MUTEX_INITIALIZER;
static char username[12];
static char password[12];
strcpy(msg.author, username);
fprintf(stderr, "Trying to connect to Citadel\n");
+ pthread_mutex_lock(&arg_mutex);
ipc = CtdlIPC_new(*argc_, *argv_, "", "");
+ pthread_mutex_unlock(&arg_mutex);
if (!ipc)
return NULL; /* oops, something happened... */
int i; /* Counters */
long runtime; /* Run time for each thread */
+ setvbuf(stderr, NULL, _IONBF, 0);
+
/* Read argument list */
for (i = 0; i < argc; i++) {
if (!strcmp(argv[i], "-n")) {
/* Then thread attributes (all defaults for now) */
pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
- fprintf(stderr, "Creating threads\n");
/* Then, create some threads */
for (i = 0; i < n; ++i) {
fprintf(stderr, "\rCreating thread %d", i);