Re: threading and multicores, pros and cons

2007-02-20 Thread Paul Boddie
Nikita the Spider wrote: > > Hmmm, I hadn't thought about that since I've never used the Cheese Shop > myself. What benefits does Cheese > Shop confer to someone looking for a package? I ask because from my > perspective it just adds overhead to package maintenance. The Python Package Index, as I

Re: threading and multicores, pros and cons

2007-02-20 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > Nikita the Spider <[EMAIL PROTECTED]> writes: > > note, there a (sort of) new module available that allows interprocess > > communication via shared memory and semaphores with Python. You can find > > it here: > > h

Re: threading and multicores, pros and cons

2007-02-19 Thread Paul Rubin
Nikita the Spider <[EMAIL PROTECTED]> writes: > note, there a (sort of) new module available that allows interprocess > communication via shared memory and semaphores with Python. You can find > it here: > http://NikitaTheSpider.com/python/shm/ This is from the old shm module that was floating

Re: threading and multicores, pros and cons

2007-02-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Maric Michaud <[EMAIL PROTECTED]> wrote: > >This is a recurrent problem I encounter when I try to sell python >solutions to my customers. I'm aware that this problem is sometimes >overlooked, but here is the market's law. Could you expand more on what exactly the p

Re: threading and multicores, pros and cons

2007-02-15 Thread skip
Maric> Le mercredi 14 février 2007 16:24, [EMAIL PROTECTED] a écrit : >> "Some time back, a group did remove the GIL from the python core, and >> implemented locks on the core code to make it threadsafe. Well, the >> problem was that while it worked, the necessary locks it made sin

Re: threading and multicores, pros and cons

2007-02-15 Thread Paul Boddie
On 15 Feb, 00:14, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > Yeah, it's the Window equivalent to fork. Does true copy-on-write, so > you can do efficient multiprocess work. Aside from some code floating around the net which possibly originates from some book on Windows systems programming

Re: threading and multicores, pros and cons

2007-02-15 Thread Rhamphoryncus
On Feb 14, 4:30 pm, "MRAB" <[EMAIL PROTECTED]> wrote: > Hmm. I wonder whether it would be possible to have a pair of python > cores, one for single-threaded code (no locks necessary) and the other > for multi-threaded code. When the Python program went from single- > threaded to multi-threaded or m

Re: threading and multicores, pros and cons

2007-02-14 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > But there are dumb thread implementations that make > a system call for every lock. Yes, a sys call on each lock access would really be horrendous. But I think that in a modern cpu, LOCK XCHG costs as much as hundreds of regular instructions. Doing t

Re: threading and multicores, pros and cons

2007-02-14 Thread John Nagle
Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: > >>If locking is expensive on x86, it's implemented wrong. >>It's done right in QNX, with inline code for the non-blocking case. > > > Acquiring the lock still takes an expensive instruction, LOCK XCHG or > whatever. I think QNX is

Re: threading and multicores, pros and cons

2007-02-14 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > If locking is expensive on x86, it's implemented wrong. > It's done right in QNX, with inline code for the non-blocking case. Acquiring the lock still takes an expensive instruction, LOCK XCHG or whatever. I think QNX is usually run on embedded cpu's w

Re: threading and multicores, pros and cons

2007-02-14 Thread John Nagle
If locking is expensive on x86, it's implemented wrong. It's done right in QNX, with inline code for the non-blocking case. Not sure about the current libraries for Linux, but by now, somebody should have gotten this right. John Nagle Paul Rubin wrote: > Maric

Re: threading and multicores, pros and cons

2007-02-14 Thread Paul Rubin
Maric Michaud <[EMAIL PROTECTED]> writes: > > "Some time back, a group did remove the GIL from the python core, and > > implemented locks on the core code to make it threadsafe. Well, the > > problem was that while it worked, the necessary locks it made single > > threaded code take significantly l

Re: threading and multicores, pros and cons

2007-02-14 Thread Maric Michaud
Le mercredi 14 février 2007 16:24, [EMAIL PROTECTED] a écrit : > "Some time back, a group did remove the GIL from the python core, and > implemented locks on the core code to make it threadsafe. Well, the > problem was that while it worked, the necessary locks it made single > threaded code take si

Re: threading and multicores, pros and cons

2007-02-14 Thread MRAB
On Feb 14, 3:24 pm, [EMAIL PROTECTED] wrote: > On Feb 13, 9:07 pm, Maric Michaud <[EMAIL PROTECTED]> wrote: > > > I've heard of a bunch of arguments to defend python's choice of GIL, but I'm > > not quite sure of their technical background, nor what is really important > > and what is not. These di

Re: threading and multicores, pros and cons

2007-02-14 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > question of library functions--you could certainly write JNI > > extensions for that stuff [access to mmap, etc.] > Sure. If you're writing extensions you can work around the GIL, too. I don't think that's comparable--if you have extensions turn

Re: threading and multicores, pros and cons

2007-02-14 Thread [EMAIL PROTECTED]
On Feb 14, 4:37 pm, Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Java has historically had no support at all for real multiple process > > solutions (akin to fork() or ZwCreateProcess() with NULL > > SectionHandle), which should make up the vast

Re: threading and multicores, pros and cons

2007-02-14 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Java has historically had no support at all for real multiple process > solutions (akin to fork() or ZwCreateProcess() with NULL > SectionHandle), which should make up the vast majority of parallel > programs (basically all of those except where you

Re: threading and multicores, pros and cons

2007-02-14 Thread [EMAIL PROTECTED]
On Feb 14, 1:44 am, Paul Rubin wrote: > > When a customer comes with his new beautiful dual-core server and > > get a basic plone install up and running, he will immediately > > compare it to J2EE and wonder why he should pay a consultant to make > > it work properly. At

Re: threading and multicores, pros and cons

2007-02-14 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, Maric Michaud <[EMAIL PROTECTED]> wrote: > This is a recurrent problem I encounter when I try to sell python solutions > to > my customers. I'm aware that this problem is sometimes overlooked, but here > is the market's law. > > I've heard of a bunch of argumen

Re: threading and multicores, pros and cons

2007-02-14 Thread Istvan Albert
On Feb 14, 1:33 am, Maric Michaud <[EMAIL PROTECTED]> wrote: > At this time, it 's not easy to explain him that python > is notflawed compared to Java, and that he will not > regret his choice in the future. Database adaptors such as psycopg do release the GIL while connecting and exchanging data

Re: threading and multicores, pros and cons

2007-02-14 Thread garrickp
On Feb 13, 9:07 pm, Maric Michaud <[EMAIL PROTECTED]> wrote: > I've heard of a bunch of arguments to defend python's choice of GIL, but I'm > not quite sure of their technical background, nor what is really important > and what is not. These discussions often end in a prudent "python has made a > c

Re: threading and multicores, pros and cons

2007-02-13 Thread Paul Rubin
Maric Michaud <[EMAIL PROTECTED]> writes: > Le mercredi 14 février 2007 05:49, Paul Rubin a écrit : > > Basically Python applications are usually not too CPU-intensive; there > > are some ways you can get parallelism with reasonable extra effort; > Basically, while not CPU intensive, application s

Re: threading and multicores, pros and cons

2007-02-13 Thread Maric Michaud
Le mercredi 14 février 2007 05:49, Paul Rubin a écrit : > Basically Python applications are usually not too CPU-intensive; there > are some ways you can get parallelism with reasonable extra effort; Basically, while not CPU intensive, application server needs to get benefit of all resources of the

Re: threading and multicores, pros and cons

2007-02-13 Thread Paul Rubin
Maric Michaud <[EMAIL PROTECTED]> writes: > If some guru has made a good recipe, or want to resume the main points it > would be really appreciated. Basically Python applications are usually not too CPU-intensive; there are some ways you can get parallelism with reasonable extra effort; and for m

threading and multicores, pros and cons

2007-02-13 Thread Maric Michaud
This is a recurrent problem I encounter when I try to sell python solutions to my customers. I'm aware that this problem is sometimes overlooked, but here is the market's law. I've heard of a bunch of arguments to defend python's choice of GIL, but I'm not quite sure of their technical backgrou