Note that there are some explanatory texts on larger screens.

plurals
  1. POHow fast can Lock() be or are proxy lists the issue?
    primarykey
    data
    text
    <p><strong>Specification of the problem:</strong></p> <p>I am running some complex tasks in python and to speed it up, I decided to use pythons multiprocessing library. It worked pretty well, but after some time I started to wonder, how much time are the Locks, I use, consuming and how much are the processes blocking each other.</p> <p><strong>The structure of processes is following:</strong></p> <p>One process that updates shared list between processes. Code of data update is something like this:</p> <pre><code>lock.acquire() list_rex[0] = pat.some_list list_rex[1] = pat.some_dictionary lock.release() </code></pre> <p>where list_rex and lock are defined by </p> <pre><code>list_rex = manager.list([[some_elements], {some_elements}]) lock = multi.Lock() </code></pre> <p>And then there are several processes, that once in a while updates their own memory space with these list.The code is as follows:</p> <pre><code>lock.acquire() some_list = list_rex[0] some_dict = list_rex[1] lock.release() </code></pre> <p>some_list and some_dict are somehow related so I can not allow processes to have information in some_list from different update than is in some_dict.</p> <p><strong>And my question is</strong>, how fast are the methods acquire() and release()? In my case they can be called within seconds and sometimes milliseconds. <strong>And/Or</strong> is there some way how to avoid using locks in my case?</p> <p>Thank you for your time.</p> <p><strong>EDIT:</strong> after considering your comment my question probably should be - how are proxy lists affecting my calculations? I use "some_list" and "some_dict" really a lot to be read from after the update.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload