Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Yes, we put #error in both places (defining and undefining USE_SEMAPHORES).
The colleague in question is Christian Tismer, he is unlikely to have gotten it
wrong. I am also curious why David Beazley kept talking about the binary
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
You do realize, that if we enable the USE_SEMAPHORE, we get the GIL behaviour
as seen on windows and with my ROUNDROBIN_GIL implementation, right?
Also, at the GIL open space talk on PyCon, David did show us the emulation
source
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
David, I urge you to reconsider:
The emulated semaphore is broken because it is unfair. It is clearly a
programming error, born out of naivete about how to implement such primitives.
Proper semaphores therefore cannot
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Googling a bit gave me this:
http://lists.apple.com/archives/darwin-kernel/2005/Dec/msg00022.html
It would appear that mac os X was at least lacking full posix semaphore support
in 2005
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
On pthreads plaforms, if the posix_sem functions aren't available (when
_POSIX_SEMAPHORES isn't defined), the python lock is implemented with a mutex
and a condition variable. This appears to be the case on Mac OS X
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
As per Antoine's suggestion, here is a patch to improve condition variable
emulation on windows.
By using the windows Semaphore (which hasn't always been available) all of the
problems in emulating condition variables using
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Maybe the state of this discussion is my fault for not being clear enough.
Let's abandon terms such as broken and roundrobin. CS theory has the
perfectly useful terms fair and unfair. The fact of the matter is this:
the pthread
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I looked at ccbench. It's a great tool. I've added two features to it (see
the attached patch)
-y option to turn off the do_yield option in throughput, and so measure
thread scheduling without assistance, and the throughput
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Fyi, here is the output using the unmodified Windows GIL, i.e. without my patch
being active:
C:\pydev\python\trunk\PCbuildpython.exe ..\Tools\ccbench\ccbench.py -t -y
== CPython 2.7a4+.0 (trunk) ==
== AMD64 Windows on 'Intel64
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
David, I don't necessarily think it is reasonable to yield every 100 opcodes,
but that is the _intent_ of the current code base. Checkinterval is set to 100.
If you don't want that, then set it higher. Your statement is like
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
David, yes messing about with processor affinities is certainly not nice.
Especially since the issue is cross-platform.
The pthreads api doesn't offer much. There is pthreadd_setschedparam(), and
pthreads_setconcurrency
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I just did some profiling. I´m using visual studio team edition which has some
fancy built in profiling. I decided to compare the performance of the
iotest.py script with two cpu threads, running for 10 seconds with processor
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
The counter is stall cycles.
During the 10 second run on my 2.4Ghz cpu, we had instruction cache miss stalls
for 2 billion cycles (2000 samples of 100 cycles per sample). That does
account for around 10% of the availible cpu
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Sorry, what I meant with the original problem was the phenomenon observed by
Antoine (IIRC) that the same CPU thread tends to hog the gil, even when
releaseing it in ceval.c.
What I have been looking at up to now is chiefly IO
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
This patch does several things:
1) Creates a separate lock type PyThread_type_gil and locking functions for
that. This allows tweaking of the GIL without affecting regular lock behaviour.
2) Creates a uniform implementation
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Martin: Well, this patch was originally conceived more as a demonstration of
the GIL problem and an alternative fix proposal.
However, it is possible to configure it so that there is no change from
existing functionality, simply
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Antoine: Please take a look, the change is really simple, particularly the
ROUNDROBIN_GIL variant which fixes the originally observed problem.
the GIL is still a lock, implemented using a mutex and a semaphore. It is
modified
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
The tp_dealloc of a type can chose to resurrect an object. the
subtype_dealloc() in typeobject.c does this when it calls the tp_del() member
and it has increased the refcount.
The problem is, that if you subclass a custom C
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
The code.InteractiveConsole() is useful to emulate a python console. However,
any code currently pushed to it must be single statements. This is because
it passes the ´single´ symbol mode to the underlying compile function
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Note, there are no regression tests for the code module.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7741
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Here is how to test this manually:
from code import InteractiveConsole
c = InteractiveConsole()
s = if True:\n print 1\nprint 2
c.push(s) #fails
c.push(s, exec) #succeeds
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6769
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Committed revision 76855 to py3k
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6654
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
yes, I'll do so as soon as I'm able.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6654
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
cool. The mindtrove one in particular seems nice. I didn't realize
that one could build boundobjects oneself.
Is there any chance of getting a weakmethod class into the weakref
module
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I have two solutions for this problem. The first is a mundane one, and
what I employed in our production environment:
class RecvAdapter(object):
def __init__(self, wrapped):
self.wrapped = wrapped
def recv(self
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
in urllib2, you will find these lines:
# Wrap the HTTPResponse object in socket's file object adapter
# for Windows. That adapter calls recv(), so delegate recv()
# to read(). This weird wrapping allows
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
See also issue 7314
--
nosy: +krisvale
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7318
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Ok, I'm closing this as a duplicate.
--
resolution: - duplicate
superseder: - multiprocessing should not wait endlessly
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7314
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I can easily port it again, and remove the traceback from the exception.
But won't we be sweeping that GC problem under the carpet then?
--
___
Python tracker rep...@bugs.python.org
http
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Thanks. Fixed in revision 76239.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7060
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
Running a debug python from the py3k branch on my windows 7 machine, 64
bit, test_multiprocessing hangs in the _TestZZZNumberOfObjects test.
I don't know this module, but I did a little digging:
The main process
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Yes, this is quite different.
After seeing this, I created issue 7314.
I didn't realize that it had anything to do with my patch but rather
blamed it on my brand new windows 7
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
See my analysis from issue 7314:
The other processes are all waiting to ReadFile(). Maybe they have yet
to run to the point where they open the socket to which the master
process is trying to connect to.
The mystery is also: Why
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Ah, okay then. Let's focus on solving 7414 then.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7060
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I can't repro on my windows box.
From what I can see, for some reason the server thread isn't
terminating, so we enter an errorhandling codepath that is broken.
The slew of errors that follow occur when the process is exiting
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
The unittest only keeps an exception _object_ around, not the associated
traceback. There should be no frames and thus reference cycles associated
with this.
I agree that the problem should be tackled, rather than swept under
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I didn't realize that the traceback was attached to the exception object
in py3k. This makes the use of such objects more dangerous because of the
circular references. The recommended practice of
exc_type, exc_obj
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Interesting. I don't have a linux machine to debug this. My patch
appears harmless enough. We are only storing an exception _object_, not
any tracebacks or such.
If this were happening on my windows machine I would put
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Fixed the bug with timer = timer in trunk in revision 75293
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7029
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Ok, thanks for the info.
We are currently using the modified version in house for monitoring our
builds and that's ok for my purposes. I have set the -C 0 and --timer
systimes.processtime as default for us.
I'll close this now
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Here is an updated patch with the superfluous timing function removed.
Please advise me on how you don't like the implementation
I'm also considering adding a '--quiet' flag that causes it to only emit
the 'total' line
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
And here is the actual patch.
--
Added file: http://bugs.python.org/file15056/pybench.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7029
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
The attached patch contains suggested fixes to pybench.py:
1) add a processtime timer for windows
2) fix a bug in timer selection: timer wasn't put in 'self'
3) Collect 'gross' times for each round
4) show statistics for per-round
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Hello Marc-Andre.
1) yes, this is nonsense. I thought that systimes was some archaeic
module that had been discontinued, since I didn't find it in the
standard modules (where time is). I didn't realize that it was a
special
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
Adding the SIO_KEEPALIVE_VALS option to socket.ioctl on windows allows a
windows user to specify the timeout and interval for TCP keepalive support
differently from the defaults specified in RFC 1122 on a per-socket basis
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
type: - feature request
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6971
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Ah yes.
Sorry, I'm no good with this system. Thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6907
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
the xmlrpclib.ServerProxy is not thread safe, no. Nor is it designed to
be. the documentation never claims that it is and the fact that the old
version was (due to a new HTTPConnection being created each time) is a
coincidence
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Yes, it is indeed a duplicate.
--
nosy: +krisvale
resolution: - duplicate
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1767370
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Ok, this means that the exception is raised after the finally, when the
thread is exiting.
Now, at this point the process is exiting and therefore we have trouble
printing the exception. (this is probably also the cause
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Good point, Tim. I'll rework it so that one of the border bytes is
used, since it needs to be a known value anyway. That should make
things less messy.
Although resoning about the breakpoint is probably incorrect since you
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
There are instances in python where memory allocated using one api
(PyMem_*) is freed using the other (PyObject_*).
The provided patch (suggested for submission once we fix all instances)
illustrates this.
It is sufficient
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
using the debugmalloc patch provided, I found only this one case when
running the testsuite.
Patch is provided. It is the simple solution of duplicating the string in
this case. A more cumbersome solution would be to allocate
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Committed this much more harmless patch to the trunk as revision 74556
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6275
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
After a short discussion on python-dev
(http://mail.python.org/pipermail/python-dev/2009-August/091069.html)
there were no objections. On python-ideas there were no responses.
Commited as revision 74558
--
resolution
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Gregory, please revert your change (74463).
There is no extra data after the response, since such data can only
be generated as a result of a new request.
Your change has disabled the HTTP/1.1 keepalive capability, causing
test
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Thanks, that's a silly bug. fixed in revision 74543.
Perhaps we need a https regression test in the test suite.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Any news on this?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6499
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
I've created http://codereview.appspot.com/100046 on Rietveld:
by passing the path component of the xmlrpc request to the dispatch
method, it
becomes possible to dispatch differently according to this. This patch
provides
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Ah, so this is an interpreter shutdown issue, it seems.
Something is causing this thread to not exit until the application exits
and that can cause all sorts of weird race conditions. I wonder why that
is happening. There must
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
No, sorry. You have just introduced the race condition by putting a print
after the evt.set(). Setting the event causes the main thread to exit
python and so anything after that line will likely not work.
In fact
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I can't reproduce this, no. I only have access to a windows machine
and you appear to have a custom build (no zlib). I need your help to
get the error message, so you need to try harder. (there are probably
at least two
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I found one problem in test_docxmlrpc.py, a missing import socket at
the top (for the socket.timeout exception handler).
Please add that, and see what happens.
But there seems to be a problem with the error handing in your build
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Well, I think the only way to move forward with this is to try to
figure out what the actual error is. Something is wrong in printing it
out to stderr, and it would be helpful to understand why it is not
being output. Perhaps
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
submitted revision 74098 and revision 74099 which should fix your issue.
Oh, and revision 74100 and revision 74101 as well (insufficient testing
on my part, tsk. tsk.)
--
___
Python
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I thought zlib was a builtin module? Why isn't it available?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6499
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Added more regression tests in revision 73986 and revision 73987
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6267
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
This is probably a race condition, where the server thread hasn't updated
the stats yet when the client is testing them. I'm so used to work with
non-preemtive scheduling in stackless python that I sometimes forget how
threads
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
No, this should take care of it. In order for the client side request to
succeed, the server must have cycled through the previous request and
updated its statistic. It is only the statistic for the final request tha
t may
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
merged testsuite fix to py3k in revision 73961
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6460
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
committed in revision 73877 and revision 73878
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6382
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
How unfortunate. This means that we need to virtualize the shutdown. I'll
submit a proposed patch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6382
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I'm uploading a patched SocketServer.py. Could you please try it out on
the gentoo box before I commit it?
--
Added file: http://bugs.python.org/file14462/SocketServer.py
___
Python
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
submitted revision 73863. Please test for me on gentoo.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6382
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
meged to py3k in revision 73845
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6381
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
This is a fork problem.
socket.close must be done on the parent, while socket.shutdown and
socket.close must be performed on the child.
I must restructure this a little bit to make it work.
--
nosy: +krisvale
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Clearly some platforms automatically set the shutdown state, and we need
to catch that error.
--
nosy: +krisvale
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Commited revision 73819
Please test on gentoo
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6381
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Fixed exception handling in
revision 73820
and
revision 73821 and revision 73822
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6267
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I've submitted a fix to 6381 in the trunk. 6382 is less clear to me, I
must take a closer look.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6267
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
committed to py3k in revision 73742
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6267
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
fyi, here is the thread from python-ideas:
http://mail.python.org/pipermail/python-ideas/2009-June/005042.html
The parallel to C++´s future rvalue reference is interesting
(http://www.artima.com/cppsource/rvalue.html, see
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Commited to 2.7 in revision 73638
--
title: Cumulative patch to http and xmlrpc - Cumulative patcc:h to http and
xmlrpc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
There is no need to port this to 3.2, it uses a completely different IO
system for socket fileobjects.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6117
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
status: open - closed
superseder: - Cumulative patcc:h to http and xmlrpc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6248
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Merged into py3k in revision 73648
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6192
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6192
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
I'm working on the 3.2 port, it needs some manual work.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6267
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Second patch applied in 73546
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6192
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
It is sometimes useful to be able to swap the contents of two lists and
this patch provides a way to do so using the fastest way possible.
a = [1, 2]
b = [3]
id(a), id(b)
(100, 101)
a.swap(b)
a
[3]
b
[1, 2]
id(a), id(b
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Indeed, I realized that it does allow overriding all kinds of behaviour
and as such may be dangerous for the unwary. But isn't it possible to
do so anyway?
One way to increase safety would be to require that the other list
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
On consideration, it is more appropariate to have the
disable_nagle_algorithm as part of StreamRequestHandler rather than in the
TCPSockerServer. It then sits right next to the rfile and wfile that
affect it.
The RequestHandlers
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Guido's comment is out of date. The assertRaises(exception) already
returns something: A context manager.
If we don't want to return the object, how about retainig it in the
context manager, then?
It is very awkward otherwise
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Uploading a slimmed down patch, with only the exc_value memeber added to
the assertRaises context manager.
--
Added file: http://bugs.python.org/file14298/unitest2.patch
___
Python
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Ok, maybe a bad choice of words :)
I don't write unittests that much, of course, but I have found that when I
am writing tests for stuff such as http, I want to verify the actual error
code, i.e. HTTPError.code, which
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
It can be useful, after a unittest.assertRaises() or assertRaisesRegexp()
to be able to take a closer look at the exception that was raised.
To this end, I propose returning the caught exception from these methods.
Additionally
New submission from Kristján Valur Jónsson krist...@ccpgames.com:
Please see
http://codereview.appspot.com/73041/show
--
messages: 89254
nosy: krisvale
severity: normal
status: open
title: Cumulative patch to http and xmlrpc
type: performance
versions: Python 2.7
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Consider this a superset of
http://bugs.python.org/issue6099
http://bugs.python.org/issue6096
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6267
701 - 800 of 924 matches
Mail list logo