SimpleXMLRPCServer performance issue in MSWin

D

danu kusmana

Hi

Im trying to figure out why the same server script I
use is running slower in Windows than in Linux.

ServerTest.py:

#! /usr/bin/env python

import SocketServer
from SimpleXMLRPCServer import *
import xmlrpclib

class Metode:
def __init__(self):
self.nilai = 0

def ambil(self):
self.nilai += 1
return self.nilai

def terima(self, NilaiBaru):
return xmlrpclib.True

class ServerTest(SocketServer.ThreadingMixIn,
SimpleXMLRPCServer):
pass

server = ServerTest(('192.168.1.108', 7777))
server.register_instance(Metode())
server.serve_forever()

I also notice that the threading in Windows only the
MainThread even when multiple clients are accessing
the server. So I assume only 1 thread is being
processed.

ClientTest.py:

#! /usr/bin/env python

import xmlrpclib

BilPrima = 0
conn = xmlrpclib.Server("http://192.168.1.108:7777")

def prima(x):
global BilPrima
for TestFactor in range(2, x):
if (x % TestFactor == 0):
break
elif (TestFactor != x - 1):
continue
else:
BilPrima = x
return BilPrima

while(1):
nilai = conn.ambil()
if nilai <= 1000000:
temp = prima(nilai)
if temp == None:
continue
else:
print temp
conn.terima(temp)
else:
break

thanks

danu




__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top