Re: [PD-dev] How to pass indeterminate args to a thread

2009-02-27 Thread Mathieu Bouchard
On Fri, 27 Feb 2009, Martin Peach wrote: Too bad, you could have tested if the compiler could handle types changing while the code was being written. rofl :) I'm sure that there's a compsci department somewhere in the world where someone is writing a thesis about a type theory that would han

Re: [PD-dev] How to pass indeterminate args to a thread

2009-02-27 Thread Martin Peach
Mathieu Bouchard wrote: > On Fri, 27 Feb 2009, Martin Peach wrote: > >> You called pthread_create() with &threadargs: >> ret = pthread_create( &thread1, NULL, mythread, &threadArgs); >> when you probably should just use threadargs, since it's already a >> pointer. >> Or else you need to deref

Re: [PD-dev] How to pass indeterminate args to a thread

2009-02-27 Thread Mathieu Bouchard
On Fri, 27 Feb 2009, Martin Peach wrote: You called pthread_create() with &threadargs: ret = pthread_create( &thread1, NULL, mythread, &threadArgs); when you probably should just use threadargs, since it's already a pointer. Or else you need to dereference the handle: post("My symbol: %s

Re: [PD-dev] How to pass indeterminate args to a thread

2009-02-27 Thread Martin Peach
B. Bogart wrote: > > I'm now getting a segfault when trying to access a member of the > structure in the thread function: > > #0 0xf7d531cb in strlen () from /lib/i686/cmov/libc.so.6 > #1 0xf7d1f648 in vfprintf () from /lib/i686/cmov/libc.so.6 > #2 0xf7d43e04 in vsnprintf () from /lib/i68

Re: [PD-dev] How to pass indeterminate args to a thread

2009-02-27 Thread B. Bogart
Thanks Claude! I got lots of help from Matju on IRC so things are compiling. I'm now getting a segfault when trying to access a member of the structure in the thread function: #0 0xf7d531cb in strlen () from /lib/i686/cmov/libc.so.6 #1 0xf7d1f648 in vfprintf () from /lib/i686/cmov/libc.so.6 #2

Re: [PD-dev] How to pass indeterminate args to a thread

2009-02-27 Thread Claude Heiland-Allen
B. Bogart wrote: > I figured that doing this with a PD type was unlikely, so I started > messing with creating a structure for my args and passing a pointer to > that. > > So I have defined my structure for a single float arg: > > struct floatArgStruct { > gphoto2_struct *gphoto2; > t

Re: [PD-dev] How to pass indeterminate args to a thread

2009-02-27 Thread B. Bogart
I figured that doing this with a PD type was unlikely, so I started messing with creating a structure for my args and passing a pointer to that. So I have defined my structure for a single float arg: struct floatArgStruct { gphoto2_struct *gphoto2; t_symbol *s; }; just under the

[PD-dev] How to pass indeterminate args to a thread

2009-02-26 Thread B. Bogart
Hey all, I've got some simple threading code working, and it looks like that will fix my HUP issues with PD and my gphoto external. Problem I'm having is that I need to pass thread arguments as a pointer to a structure. Are there some PD types I can use to make this work? (A_GIMME?) Or do I nee