Re: Threading question .. am I doing this right?

2022-02-28 Thread Robert Latest via Python-list
Chris Angelico wrote: > I'm still curious as to the workload (requests per second), as it might still > be worth going for the feeder model. But if your current system works, then > it may be simplest to debug that rather than change. It is by all accounts a low-traffic situation, maybe one reques

Re: Threading question .. am I doing this right?

2022-02-25 Thread Chris Angelico
On Sat, 26 Feb 2022 at 05:16, Robert Latest via Python-list wrote: > > Chris Angelico wrote: > > Depending on your database, this might be counter-productive. A > > PostgreSQL database running on localhost, for instance, has its own > > caching, and data transfers between two apps running on the s

Re: Threading question .. am I doing this right?

2022-02-25 Thread Robert Latest via Python-list
Greg Ewing wrote: > * If more than one thread calls get_data() during the initial > cache filling, it looks like only one of them will wait for > the thread -- the others will skip waiting altogether and > immediately return None. Right. But that needs to be dealt with somehow. No data is no data.

Re: Threading question .. am I doing this right?

2022-02-25 Thread Robert Latest via Python-list
Chris Angelico wrote: > Depending on your database, this might be counter-productive. A > PostgreSQL database running on localhost, for instance, has its own > caching, and data transfers between two apps running on the same > computer can be pretty fast. The complexity you add in order to do > you

Re: Threading question .. am I doing this right?

2022-02-25 Thread Greg Ewing
On 25/02/22 1:08 am, Robert Latest wrote: My question is: Is this a solid approach? Am I forgetting something? I can see a few of problems: * If more than one thread calls get_data() during the initial cache filling, it looks like only one of them will wait for the thread -- the others will sk

Re: Threading question .. am I doing this right?

2022-02-24 Thread Chris Angelico
On Fri, 25 Feb 2022 at 06:54, Robert Latest via Python-list wrote: > > I have a multi-threaded application (a web service) where several threads need > data from an external database. That data is quite a lot, but it is almost > always the same. Between incoming requests, timestamped records get a

Threading question .. am I doing this right?

2022-02-24 Thread Robert Latest via Python-list
I have a multi-threaded application (a web service) where several threads need data from an external database. That data is quite a lot, but it is almost always the same. Between incoming requests, timestamped records get added to the DB. So I decided to keep an in-memory cache of the DB records t

Re: threading question

2009-09-10 Thread MRAB
Mag Gam wrote: Hello, Currently, I am using a bash script to ssh into 400 servers and get an output, ie check if a file exists on a local filesystem. I am doing this linearly, however I am interesting in doing this with threads and more important using Python standard threading library. My pse

threading question

2009-09-10 Thread Mag Gam
Hello, Currently, I am using a bash script to ssh into 400 servers and get an output, ie check if a file exists on a local filesystem. I am doing this linearly, however I am interesting in doing this with threads and more important using Python standard threading library. My pseudo code would be

Re: Newbie Threading Question

2008-07-13 Thread Lev Elbert
On Jul 13, 8:33 am, Sparky <[EMAIL PROTECTED]> wrote: > It seems strange, but I can't find a list of operating systems which > support / don't support threading in Python. Can anyone point me in > the right direction? > > Thanks, > Sam Here is the list (from Python documentation of thread module):

Re: Newbie Threading Question

2008-07-13 Thread Sparky
On Jul 13, 1:30 pm, Nick Dumas <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I'm not an expert on Python threading, so don't take my word as low, > however, I believe that there's no need for a list of systems which > support it because the Python virtual machine

Re: Newbie Threading Question

2008-07-13 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm not an expert on Python threading, so don't take my word as low, however, I believe that there's no need for a list of systems which support it because the Python virtual machine handles it. Thus, any system which supports Python (or at least Pytho

Newbie Threading Question

2008-07-13 Thread Sparky
It seems strange, but I can't find a list of operating systems which support / don't support threading in Python. Can anyone point me in the right direction? Thanks, Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: basic threading question

2007-10-31 Thread [david]
thanx :~) -- http://mail.python.org/mailman/listinfo/python-list

Re: basic threading question

2007-10-31 Thread Bryan Olson
[david] wrote: > If I have 37 threads, all calling a large function 'f', are the formal > parameters thread safe? > > That is, will the formal parameters be trashed? Do you need to use > locks or semaphores before using formal parameters? Are the labels for > formal parameters static? > > If I

Re: basic threading question

2007-10-31 Thread [david]
[EMAIL PROTECTED] wrote: > On Oct 30, 7:58 pm, "bambam" <[EMAIL PROTECTED]> wrote: >> Are function variables thread safe? >> >> def f(a): >> # whatever >> return float(a) >> >> Is that OK? >> >> def f(a): >> #whatever >> b=a: >> #whatever: >> return float(b) >> >> Is that OK

Re: basic threading question

2007-10-30 Thread chris . monsanto
On Oct 30, 7:58 pm, "bambam" <[EMAIL PROTECTED]> wrote: > Are function variables thread safe? > > def f(a): > # whatever > return float(a) > > Is that OK? > > def f(a): > #whatever > b=a: > #whatever: > return float(b) > > Is that OK? > > Steve. Huh? -- http://mail.python

basic threading question

2007-10-30 Thread bambam
Are function variables thread safe? def f(a): # whatever return float(a) Is that OK? def f(a): #whatever b=a: #whatever: return float(b) Is that OK? Steve. -- http://mail.python.org/mailman/listinfo/python-list

Threading Question

2005-06-30 Thread ncf
I've used python for a while now, and am startting to dig into threads and sockets (using asyncore/asynchat). Through all this, I've been using the -v option on python to generate verbose output and try to pinpoint any potential problems...however, one warning is eluding me as to it's cause/resolut