> From: Alex Fabijanic <aleskx@...>
> On Sat, Mar 29, 2008 at 1:09 PM, Larry Lewis wrote:
> > I'd like to add the ability of spawning a Thread directly on a static
> function. The three options I see in order of preference:
> > 1. Add a static function to Thread to simply wrap the underlying call: static
> void Thread::create(void (*target)());
> > In this case, the implementation could just pass the target as the thread's
> entry function argument and call it directly.
> > 2. Add a new Runnable derived class (StaticRunnableAdapter or a non-templated
> > 3. Add a member function to Thread to directly support this: void
> Thread::start(void (*target)());
> > Any thoughts or opinions?
> I have tried out to code something along the lines of item 2) and it
> works fine. As for 1) and 3), I'm more inclined toward implementing
> 3). BTW, I've found a glitch in Win32 ThreadImpl (submitted a patch
> and will take care of it in the svn).
Any of the options will work for me -- whatever best fits the philosophy of POCO. With the current implementation, I have to call some class instance member function and then forward control on to the static function, which is slightly cumbersome. Let me know if I should code up a patch here.
On a slightly related topic, did you happen to notice the patch I submitted for thread stack size?
I'd like to push this but haven't tested the Win32 implementation and wanted to get some consensus before doing so.