[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) |
Hello,
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
available.
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?
Sven
--
/* Fuck me gently with a chainsaw... */
(David S. Miller in /usr/src/linux/arch/sparc/kernel/ptrace.c)
/me is address@hidden, http://sven.gegg.us/ on the Web
httpd-test.c
Description: Text Data
- [libmicrohttpd] threading model question,
Sven Geggus <=