[Spread-users] SP_join from different tread as SP_receive

Mike Simon msimon at sj2tech.com
Fri Jun 15 12:47:11 EDT 2007


I just started using spread and am seeing that if SP_join's that are 
performed on a different thread from SP_receive don't work.  For example

Doesn't work

mailbox box;

void* thread_proc( void* arg )
{
   while(1) {
    SP_receive( box, groups .... );
    processMessages();
}

void func_call_from_diff_thread( )
{
    SP_join( box, "mygroup" );
}


DOES work

mailbox box;

void* thread_proc( void* arg )
{
//hack to see if it works
    SP_join( box, "mygroup" );
   while(1) {
    SP_receive( box, groups .... );
    processMessages();
}

void func_call_from_diff_thread( )
{
}

Is this a bug?  Or is there a good workaround?

Mike Simon




More information about the Spread-users mailing list