You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work with RPYC classic server (see code below) under Windows XP.
When I have BgServingThread, 100 calls of execute() takes about 10 seconds.
Without BgServingThread, 100 calls of execute() takes about 0.01 seconds.
Why? What can I do to have both BgServingThread running and execute() working fast?
import rpyc
import time
c = rpyc.classic.connect("localhost")
t = rpyc.BgServingThread(c) # delete this line for fast execute
start = time.time()
for i in range(100):
c.execute("newObj = %d" % (i))
stop = time.time()
print "added %d simple objects one by one, %f seconds" % (100, stop - start)
t.stop() # delete this line if deleted line above
Need any ideas...
The text was updated successfully, but these errors were encountered:
the bg server thread calls serve with a timeout of 0.1 seconds each time. while it attempts to serve, no other thread can use the connection, so calls to c.execute (or any other remote invocation, for that matter) have to wait for an average of 0.1 seconds before being able to lock the connection and send their data.
100 calls * 0.1 second delay for lock = 10 seconds.
i will try to find a better way to solve the contention between threads sharing the connection... but it won't happen in 3.1.0
I work with RPYC classic server (see code below) under Windows XP.
When I have BgServingThread, 100 calls of execute() takes about 10 seconds.
Without BgServingThread, 100 calls of execute() takes about 0.01 seconds.
Why? What can I do to have both BgServingThread running and execute() working fast?
Need any ideas...
The text was updated successfully, but these errors were encountered: