[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] threading model question

From: Sven Geggus
Subject: [libmicrohttpd] threading model question
Date: Thu, 27 Oct 2011 21:29:52 +0200
User-agent: Mutt/1.5.20 (2009-06-14)


I try to use libmicrohttpd in conjunction with a main function which
acquires data in an endless loop (currently every 4 seconds).

What I want to achieve is that all the current client connections
with an active request for this data will block until it is

Thus I decided to go for the MHD_USE_THREAD_PER_CONNECTION model.

I tried to use pthread_cond_wait and pthread_cond_broadcast to
implement the blocking scheme, but unfortunately this does not work
as expected when more than one client is in use.

Attached is a broken down example code.

compile with:
cc -o httpd-test -g -Wall -W httpd-test.c -lmicrohttpd

As a client I currently use a
couple of "wget -q -O - http://localhost:8888"; calls.

Any hint?


/* Fuck me gently with a chainsaw... */
(David S. Miller in /usr/src/linux/arch/sparc/kernel/ptrace.c)

/me is address@hidden, on the Web

Attachment: httpd-test.c
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]