Hi Barry

Thanks for answering my question. But I still feel confused with the
daemon.pl, it's a perl script that used to set up Moses server.
The script is in the folder ~/mosesdecoder/contrib/web/bin . And the line
43 is *my $pid = open2 ($MOSES_OUT, $MOSES_IN, $MOSES, '-f', $MOSES_INI,
'-t'); *It doesn't add the multi-thread switch -th//-threads (th): number
of threads to use in decoding (defaults to single-threaded).So I think this
server is set up defaults to single-threaded. But even if I modify this
line to *my $pid = open2 ($MOSES_OUT, $MOSES_IN, $MOSES,'-th','5', '-f',
$MOSES_INI, '-t'); *My test code will still encounter the  [Errno 10060]  I
have mentioned last mail.
Is there some document which explains the mutil-thread in Moses server
specifically?Maybe there's some restrictions when setting  a server?

ps: I use a virtual machine to run Moses server. It only has one processor.
I wonder if this could affect the results.

Best regards
Sephiroth

2012/11/1 Barry Haddow <[email protected]>

>  Hi Sephiroth
>
> I don't know about daemon.pl, but the Moses server supports
> multi-threaded operation
>
> http://www.statmt.org/moses/?n=Moses.AdvancedFeatures#ntoc27
>
> cheers - Barry
>
>
> On 01/11/12 06:32, 曹骏 wrote:
>
> Dear support
>
>  I have used daemon.pl which has been introduced in chapter *Translating
> web pages with Moses to* set a Moses server. And of course it could work
> and translates string normally. However when I use multi-thread to send
> requests to the server at the same time some threads may catch the error:
> [Errno 10060] A connection attempt failed because the connected party did
> not properly respond after a period of time, or established connection
> failed because connected host has failed to respond. My test code are as
> follows:
>
>  #python
> import threading
> import socket
> class ThreadClass(threading.Thread):
>     def run(self):
>         clisock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
>         server='127.0.0.1'
>         clisock.connect((server,8089))
>         clisock.send("could not connect it\n")
>         print self.getName()+clisock.recv(1000)
>         clisock.close()
> for i in range(20):
>     t=ThreadClass()
>     t.start()
>
>  Does the Moses translation engine supports multi-thread? Or there're
> some restrictions about the number of the thread? Or I have to modify some
> code in daemon.pl?
>
>
>  Best regards
> Sephiroth
>
>
> _______________________________________________
> Moses-support mailing 
> [email protected]http://mailman.mit.edu/mailman/listinfo/moses-support
>
>
>
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to