Is there any reason to use the lightweight process system calls directly
in a program instead of using Solaris threads or pthreads?
The Wine project currently uses them to emulate the Windows threading
model, but it is incredibly unstable on Solaris compared to Linux. I'm
wondering if that has something to do with the following use of
lightweight processes:
ucontext_t context;
_lwp_makecontext( &context, (void(*)(void *))SYSDEPS_StartThread, teb,
NULL, teb->stack_base, (char *)teb->stack_top
- (char *)teb->stack_base );
if ( _lwp_create( &context, 0, NULL ) )
return -1;
return 0;
What we're trying to do is translate the following Linux-specific code:
#ifdef HAVE_CLONE_SYSCALL
if (clone( (int (*)(void *))SYSDEPS_StartThread, teb->stack_top,
CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, teb ) < 0)
return -1;
/* FIXME: close the child socket in the parent process */
/* close( thread->socket );*/
return 0;
#endif
with something that does the equivalent. Sun's score utility says to
use vfork, but it seems we need more options than zero.
Sent via Deja.com http://www.deja.com/
Before you buy.