From 5d775d64bdec554b9842823bd1c46263210425fd Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Tue, 1 Mar 2016 10:42:40 +0100 Subject: 1. multithreading: - Enable multiprocessing for api_server - Enable mutrithreading for html_server 2. py: - extract pcilib->py bases from pcilib->py functions - add api for interact directly with pcilib->py without pcilib context. 3. pcipywrap - Add scripts handling. --- xml/scripts/test_script.py | 4 ++++ xml/scripts/test_script2.py | 4 ++++ xml/test/test_prop_mt.py | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 xml/scripts/test_script.py create mode 100644 xml/scripts/test_script2.py (limited to 'xml') diff --git a/xml/scripts/test_script.py b/xml/scripts/test_script.py new file mode 100644 index 0000000..16e4adb --- /dev/null +++ b/xml/scripts/test_script.py @@ -0,0 +1,4 @@ +description='this is a test script' + +def run(ctx, inpt): + return ctx.get_registers_list(); diff --git a/xml/scripts/test_script2.py b/xml/scripts/test_script2.py new file mode 100644 index 0000000..16e4adb --- /dev/null +++ b/xml/scripts/test_script2.py @@ -0,0 +1,4 @@ +description='this is a test script' + +def run(ctx, inpt): + return ctx.get_registers_list(); diff --git a/xml/test/test_prop_mt.py b/xml/test/test_prop_mt.py index f8c63d0..3714597 100644 --- a/xml/test/test_prop_mt.py +++ b/xml/test/test_prop_mt.py @@ -4,15 +4,15 @@ lock = threading.Lock() def read_from_register(ctx, value): with lock: - ctx.lock('lock5') + ctx.lock('lock12') cur = read_from_register.counter read_from_register.counter += 1 - for i in range (0, 5): + for i in range (0, 60): time.sleep(0.1) print cur out = ctx.get_property('/test/prop3') / 2 - ctx.unlock('lock5') + ctx.unlock('lock12') return out -- cgit v1.2.3