Hi Fong Po Po,
These lines are thread locking and waiting process. They are used for
controlling the running order and resource of multi-threads. You can view
some simple introduction of multi-thread programming.
Best Regards,
Lang Jun
2011/4/29 Fong Po Po <[email protected]>
> Dear:
>
> in
>
> https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk/moses/src/
>
> I have read C++ file ThreadPool.cpp but I don't understand these following
> scripts:
>
> void Moses::ThreadPool::Execute()
> line 41 boost::mutex::scoped_lock lock(m_mutex); ( what does this
> line mean?)
> line 43 m_threadNeeded.wait(lock); ( what does this line mean?)
>
> void Moses::ThreadPool::Submit( Task* task )
> line 67 m_threadNeeded.notify_all(); ( what does this line mean?)
>
> void Moses::ThreadPool::Stop(bool processRemainingJobs)
> line 83 m_threadAvailable.wait(lock); ( what does this line mean?)
>
> Can you help me?
>
> Best Regards,
> Fong Pui Chi
>
> _______________________________________________
> Moses-support mailing list
> [email protected]
> http://mailman.mit.edu/mailman/listinfo/moses-support
>
>
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support