pthreads problem

2005-08-07 Thread Gerhard Hoffmann
Hi Phil, I think the easiest solution for your problem is something like this: #include #include volatile unsigned long len = 0; pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; static void cleanup_handler(void *arg) { (void)pt

Re: pthreads problem

2005-08-06 Thread Philip S. Schulz
Philip S. Schulz wrote: P.S:: Attached is the full example. Oh, well, apparently I'm too dumb to use my mail reader correctly... it is at http://aliue.homeunix.net:8000/threads.c Phil. ___ freebsd-hackers@freebsd.org mailing list http://lists.fre

pthreads problem

2005-08-06 Thread Philip S. Schulz
Hi! From the what's-wrong-with-my-code department... I'm having trouble with two threads accessing a queue. One thread writes to it while the other one reads from the queue. I'd like the consumer to run until the main thread (which is the producer) decides that the consumer thread should ex

Re: PThreads problem

2002-11-27 Thread Peter Pentchev
On Tue, Oct 22, 2002 at 08:24:05AM +0300, Peter Pentchev wrote: > On Mon, Oct 21, 2002 at 10:31:48PM +0200, Linus Kendall wrote: > [snip] > > > > That was very thorough, thanks! Now I at least have a notion of what > > is going on. Since this is slightly urgent I guess a hack into the > > libcurl

Re: PThreads problem

2002-10-22 Thread Terry Lambert
Bruce M Simpson wrote: > On Mon, Oct 21, 2002 at 02:03:52PM -0700, Terry Lambert wrote: > > It is more correct to say that libcurl makes an assumption about > > signal delivery which is not guaranteed by POSIX, and therefore > > libcurl will not work with *any* POSIX compliant threads > > implement

Re: PThreads problem

2002-10-22 Thread Daniel Eischen
On Tue, 22 Oct 2002, Peter Pentchev wrote: > On Tue, Oct 22, 2002 at 12:31:32PM +0100, Bruce M Simpson wrote: > > On Mon, Oct 21, 2002 at 02:03:52PM -0700, Terry Lambert wrote: > > > It is more correct to say that libcurl makes an assumption about > > > signal delivery which is not guaranteed by P

Re: PThreads problem

2002-10-22 Thread Peter Pentchev
On Tue, Oct 22, 2002 at 12:31:32PM +0100, Bruce M Simpson wrote: > On Mon, Oct 21, 2002 at 02:03:52PM -0700, Terry Lambert wrote: > > It is more correct to say that libcurl makes an assumption about > > signal delivery which is not guaranteed by POSIX, and therefore > > libcurl will not work with *

Re: PThreads problem

2002-10-21 Thread Peter Pentchev
On Mon, Oct 21, 2002 at 10:31:48PM +0200, Linus Kendall wrote: [snip] > > That was very thorough, thanks! Now I at least have a notion of what > is going on. Since this is slightly urgent I guess a hack into the > libcurl source code to try to remove the sigalarms would do the trick > (in my case

Re: PThreads problem

2002-10-21 Thread Peter Pentchev
On Mon, Oct 21, 2002 at 04:48:34PM +0300, Peter Pentchev wrote: > On Mon, Oct 21, 2002 at 03:24:08PM +0200, Linus Kendall wrote: > > m?n 2002-10-21 klockan 14.45 skrev Peter Pentchev: > > > On Mon, Oct 21, 2002 at 01:35:59PM +0200, Linus Kendall wrote: > > > > Hi, > > > > > > > > I'm trying to por

Re: PThreads problem

2002-10-21 Thread Terry Lambert
Linus Kendall wrote: > That was very thorough, thanks! Now I at least have a notion of what > is going on. Since this is slightly urgent I guess a hack into the > libcurl source code to try to remove the sigalarms would do the trick > (in my case). In the general case it seems like there's a rather

Re: PThreads problem

2002-10-21 Thread Linus Kendall
mån 2002-10-21 klockan 21.44 skrev Peter Pentchev: > On Mon, Oct 21, 2002 at 06:33:46PM +0200, Linus Kendall wrote: > > Answer inline below. > > > > m?n 2002-10-21 klockan 15.50 skrev Peter Pentchev: > > > On Mon, Oct 21, 2002 at 04:48:34PM +0300, Peter Pentchev wrote: > > > > On Mon, Oct 21, 2002

Re: PThreads problem

2002-10-21 Thread Daniel Eischen
On Mon, 21 Oct 2002, Peter Pentchev wrote: > Okay, I can see what the problem is; however, I have absolutely no idea > how it is to be solved :( > > The DNS resolution routines of libcurl use alarm() as a timeout > mechanism for the system DNS resolving functions. To enforce the > timeout even wh