Home Help Center

where to invoke the new Thread in AMD

Hi,
I have seen the example that was previously posted in the forum...and have gone about it as said...the code was as given

class interpolateJobThread : public IceUtil::Thread
{
virtual void run()
{
while(1)
{
_jobMutex.lock();

if(_jobs.size()!=0)
{
JobPtr firstJob=(JobPtr)_jobs.front();
_jobs.pop_front();
firstJob->execute();
}

_jobMutex.unlock();
Sleep(100);
}
}
};


code8
int main()
{
//...
//we can also start a thead pool to ...
IceUtil::ThreadPtr t = new interpolateJobThread;
IceUtil::ThreadControl tc = t->start();
//...
}

I am writing the code in Java...I am not sure where to create the interpolateJobThread instance and invoke the start method..
please help. Thanks.

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    This is more a Java question so I would recommend to post it in a Java forum instead :). In any case, you'll find code to create and start a Java thread in the IceJ-2.1.1/demo/Ice/session demo for example.

    Benoit.
Sign In or Register to comment.