Skip to content

Instantly share code, notes, and snippets.

@dongliu
Created November 16, 2012 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dongliu/4091098 to your computer and use it in GitHub Desktop.
Save dongliu/4091098 to your computer and use it in GitHub Desktop.
snapshot ca multi-threading
def get(d, pv_name, size, start, pid):
ch = ca.create_channel(pv_name, connect=False, auto_cb=False)
if ca.connect_channel(ch, timeout=1.0):
d[pv_name] = ca.get(ch, wait=True)
else:
d[pv_name] = 'not connected'
if len(d) == size:
print int(round((time.time() - start) * 1000))
os.kill(pid, signal.SIGTERM)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment