Nik Barron
Nik.Barron at pennantplc.co.uk
Thu Jun 27 08:06:42 EST 2002
> > This works fine in Win32; I do the locking by a simple > > dictionary, e.g. if user nik is editing requirement foo, editLocks['foo'] = > > 'nik' and so on. > > How do you make other threads wait for editing on foo to finish? By > busy-waiting? Yep. The edit is fairly quick and there's only a dozen or so users, so the chance of a collision is fairly small to begin with. > The standard approach is to keep some kind of external shared storage > between the different children. If you just need to share a single > hashtable, Python's 'shelve' library could be quite simple to use and > satisfactory. Things based on some kind of shared-memory DB will not > necessarily be any slower than threads in a single memory space. Thanks, I'll have a look... > To make you feel better about this, there are some benefits to the > Unix approach: Indeed. Unfortunately for the immediate future it'll probably have to stick on Win32 as I need to get it up and running this week, but v2 should be a lot nicer :-) Many thanks again for the suggestions Nik
|