Re: Yappi error context not found

2011-02-23 Thread k3xji
On 10 Şubat, 08:38, Brian dribna...@gmail.com wrote: I'm posting here because I can't find a Yappi specific mailing list. I've been using the rather brilliant Yappi fromhttp://code.google.com/p/yappi/ It works well for small programs with a few threads. However, when trying to run it over

Re: Porting PEP 3148 to 2.x series

2010-09-18 Thread k3xji
I'll probably port 3148 to Python 2.x after its running happily in   Python 3.2. Very good news. One idea: Once library becomes reliable enough- of course there are various use cases - but IMHO it perfectly fits the problem domain of implementing an async DB library on top of it. I suppose

Porting PEP 3148 to 2.x series

2010-09-17 Thread k3xji
Hi, Is there any work on porting PEP 3148 back to 2.x series. That is a wonderful PEP, any many long-running applications are really in need of some stable library for handling stuff in async way just as proposed in this PEP. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: select() call and filedescriptor out of range in select error

2010-09-16 Thread k3xji
Please show the *exact* error message, including the traceback, by copying and pasting it. Do not retype it by hand, or summarize it, or put it into your own words. Unfortunately this is not possible. The logging system I designed only gives the following information, as we have millions of

select() call and filedescriptor out of range in select error

2010-09-15 Thread k3xji
Hi all, We have a select-based server written in Python. Occasionally, maybe twice a month there occurs a weird problem, select() returns with filedescriptor out of range in select() error. This is of course a normal error and handled gracefully. Our policy is to take down few users for select()

yappi 0.51 released

2010-05-15 Thread k3xji
Hi all, Yappi (Yet Another Python Profiler) 0.51 released. See the version highlights: * OPTIMIZATION:Use per-pit cpc for better accuracy in different timing_sample values. Now timing_sample is not linearly decreasing the timing accuracy for most of the applications tested. We reduced the

yappi v0.42 released

2010-03-06 Thread k3xji
Hi all, yappi(yet another python profiler with multithreading support) released. See: http://code.google.com/p/yappi/ Thanks, -- http://mail.python.org/mailman/listinfo/python-list

yappi v0.3

2009-11-22 Thread k3xji
Hi, yappi(yet another python profiler) is a Python Profiler with multithreading support. This is the last beta version with some major changes and bugfixes: v0.3 Changes - [+] yappi did not compile out of box on VS2008. Fix the compile issues. (Thanks to Kevin Watters) [+] tidy up stat

yappi v0.3

2009-11-22 Thread k3xji
Hi, yappi(yet another python profiler) is a Python Profiler with multithreading support. This is the last beta version with some major changes and bugfixes: v0.3 Changes - [+] yappi did not compile out of box on VS2008. Fix the compile issues. (Thanks to Kevin Watters) [+] tidy up stat

[ANN] yappi v0.2

2009-11-07 Thread k3xji
yappi(Yet Another Python Profiler) v0.2 released. Documentation is updated. Features: * very efficient multi-threading profiling. * profiler pollution effect (the overhead that the profiler put on an application) can be viewed from the statistic results. * may help to avoid deadlocks.

[ANN] yappi v0.2 - link

2009-11-07 Thread k3xji
Forgot to give the link: http://code.google.com/p/yappi/ Twitter: http://twitter.com/sumercip Thanks, -- Sumer Cip -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

ANN: yappi 0.1 beta : Yet Another Python Profiler

2009-10-10 Thread k3xji
Hi all, After implementing a game server on which 100k people playing games per-day, it turns out to be that continuous and efficient profiling is key to improve an long-running applications like these. With this idea in mind, I am motivated to write a profiler. I am not a Python expert or even

YASS (Yet Another Success Story)

2009-06-20 Thread k3xji
Hi all, Started a project year ago with hard goals in mind : Developing a game server which can handle thousands of clients simultaneously.System must be stable, scalable, efficient, and if the client need to migrate the server to another OS, this will be a matter of time, if possible without

sys.setcheckinterval() never gets updated second time. Bug?

2009-04-17 Thread k3xji
Hi all, Yesterday I opened a thread for this issue where I was calling sys.setcheckinterval() with sys.maxint and then try to set it to a lower value but did not succeed with that. Here it is:

Unpreempted behavior with sys.setcheckinterval

2009-04-16 Thread k3xji
Hi all, I want unpreempted behavior for some application and do some testing as below. Well the unpreemption behavior is working fine with sys.setcheckinterval(sys.maxint). However, when I set the interval to a lower value, the thread does not being preempted anymore, it runs until it is

Re: C API String Parsing/Returning

2009-04-07 Thread k3xji
Whan I run the following function, I see a mem leak, a 20 mb of memory is allocated and is not freed. Here is the code I run: import esauth for i in range(100): ... ss = esauth.penc('sumer') ... for i in range(100): ... ss = esauth.penc('sumer') ... And here is the penc()

Python C API String Memory Consumption

2009-04-07 Thread k3xji
When I run the following function, I seem to have a mem leak, a 20 mb of memory is allocated and is not freed. Here is the code I run: import esauth for i in range(100): ... ss = esauth.penc('sumer') ... for i in range(100): ... ss = esauth.penc('sumer') ... And here is the

Re: Python C API String Memory Consumption

2009-04-07 Thread k3xji
Interestaing I changed malloc()/free() usage with PyMem_xx APIs and the problem resolved. However, I really cannot understand why the first version does not work. Here is the latest code that has no problems at all: static PyObject * penc(PyObject *self, PyObject *args) { PyObject *

C API String Parsing/Returning

2009-04-06 Thread k3xji
Hi all, This might be a newbie question. I am trying to implement a simple string decoder/encoder algorithm. Just suppose I am substrcating some values from the string passed as a parameter to the function and I want the function to return encoded/decoded version of the string. Here is the call:

Re: C API String Parsing/Returning

2009-04-06 Thread k3xji
todo with ref counts but I don't understand the problem. On Apr 6, 3:13 pm, k3xji sum...@gmail.com wrote: Hi all, This might be a newbie question. I am trying to implement a simple string decoder/encoder algorithm. Just suppose I am substrcating some values from the string passed

Re: Read-Write Lock vs primitive Lock()

2008-12-30 Thread k3xji
Note that the thread acquires the lock ONCE, repeats several thousand times an assignment to a *local* variable called GLOBAL_VAR (!), finally releases the lock and exits. As every thread does the same, they just   run one after another, they never have a significant overlap. Ok.

Re: Read-Write Lock vs primitive Lock()

2008-12-30 Thread k3xji
Note that the thread acquires the lock ONCE, repeats several thousand times an assignment to a *local* variable called GLOBAL_VAR (!), finally releases the lock and exits. As every thread does the same, they just   run one after another, they never have a significant overlap. Ok.

Read-Write Lock vs primitive Lock()

2008-12-29 Thread k3xji
Hi, I am trying to see on which situations does the Read-Write Lock performs better on primitive Lock() itself. Below is the code I am using to test the performance: import threading import locks import time class mylock(object): def __init__(self): self.__notreading =

Re: Read-Write Lock vs primitive Lock()

2008-12-29 Thread k3xji
On 29 Aralık, 11:52, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Mon, 29 Dec 2008 05:56:10 -0200, k3xji sum...@gmail.com escribió: I  am trying to see on which situations does the Read-Write Lock performs better on primitive Lock() itself. Below is the code I am using to test

Simple multithreaded profiler using decorators fails on some built-in methods

2008-12-15 Thread k3xji
Hi all, I have written a simple multithreaded profiler using decorators. Below is how it works: 1) Iterate all modules in sys.modules and iterate each function/ class methods inside them, means all of them including built-in methods. 2) Decorate the methods and functions to a global function. 3)

Python Runtime Method Call Binding

2008-12-04 Thread k3xji
Hi, Is there a way to hook a function call in python? I know __getattr__ is doing for variables, it is giving us a chance before a field is initialized. Do we have same functionality for methods? Example: class Foo(object): def __call_method__(self, ...) # just pseudo print 'A

Re: Python Runtime Method Call Binding

2008-12-04 Thread k3xji
On Dec 4, 5:48 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Thu, 04 Dec 2008 06:23:28 -0800, k3xji wrote: Hi, Is there a way to hook a function call in python? I know __getattr__ is doing for variables, What do you mean variables? Do you mean attributes

Re: Python Runtime Method Call Binding

2008-12-04 Thread k3xji
test -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Runtime Method Call Binding

2008-12-04 Thread k3xji
Thanks for the tips. 3/ Now fact is that even all this won't probably be enough to implement a robust generic profiler - something which obviously requires a deep understanding of the language *and* it's implementation. Indeed. Maybe not generic,but with these information at least I can write my

Re: Python C/API simple debugging

2008-11-26 Thread k3xji
On Nov 26, 1:34 pm, Stefan Behnel [EMAIL PROTECTED] wrote: k3xji wrote: I am new to Python C API and finding it difficult to debug C extensions. So, basically I want to see the value of an integer value during the C API. Here is the code: #define LAST_MIX_VAL 0xDEADBEEF static

Re: Python C/API simple debugging

2008-11-26 Thread k3xji
On Nov 26, 1:43 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: k3xji wrote: On Nov 26, 1:34 pm, Stefan Behnel [EMAIL PROTECTED] wrote: k3xji wrote: I am new to Python C API and finding it difficult to debug C extensions. So, basically I want to see the value of an integer value during

Python C/API simple debugging

2008-11-26 Thread k3xji
Hi all, I am new to Python C API and finding it difficult to debug C extensions. So, basically I want to see the value of an integer value during the C API. Here is the code: #define LAST_MIX_VAL 0xDEADBEEF static PyObject * chash(PyObject *self, PyObject *args) { unsigned int key,result;

PEP 249 - DB API question

2008-11-04 Thread k3xji
Hi all, As development goes on for a server project, it turns out that I am using the MySQLDB and DB interactions excessively. One questions is just bothering me, why don't we have a timeout for queries in PEP 249 (DB API)? Is it really safe to wait for a query to finish, means, is it always

Re: PEP 249 - DB API question

2008-11-04 Thread k3xji
Try spawning a new process to run your query in. Use the multiprocessing library. Your main application can then just poll the db/query processes to see if they're a) finished and b) have a result Your application server can also c0 kill long running queries that are deemed to be taking

Immutable object thread-safety

2008-10-26 Thread k3xji
Hi all, This will probably be a long question/short answer, sorry, but I have wandered net about the subject and really feel cannot find just enough information.I want to ask my question by giving an example to explicitly express my understanding which may be also wrong: So, let's have a string

Immutable object thread-safety

2008-10-26 Thread k3xji
Hi all, This will probably be a long question/short answer, sorry, but I have wandered net about the subject and really feel cannot find just enough information.I want to ask my question by giving an example to explicitly express my understanding which may be also wrong: So, let's have a string

Re: Abnormal Interpreter Shutdown

2008-10-21 Thread k3xji
I think what I am looking for is SetConsoleCtrlHandler(..) which receives signals for CTRL+C and system shutdown. I don't want to take the power outage into account because as far as I can see there is no portable/simple/reliable way to accomplish that. So, thanks for the tip again. So what is

Re: I want to release the GIL

2008-10-21 Thread k3xji
See yield() statement. -- http://mail.python.org/mailman/listinfo/python-list

Abnormal Interpreter Shutdown

2008-10-20 Thread k3xji
Hi all, Is there anyway to detect abnormal interpreter shutdown like (closing from task manager, power shutdown of the PC..etc)? Regards, -- http://mail.python.org/mailman/listinfo/python-list

Re: Abnormal Interpreter Shutdown

2008-10-20 Thread k3xji
If you mean detecting abnormal shutdown after the fact, as opposed to catching it while happening, you could create an empty temp file when the program starts and delete it upon normal termination. I have a server application, and I want to take some actions *before* the shutdown. I assumed to

Python OOP question

2008-09-25 Thread k3xji
Hi all, I am trying to develop a game-server in python. Design is as following: - ConnectionManager - handling/distributing incoming connections - IOManager - handling IO recv/send operations on sockets. (inheritable) - Socket - basic async socket object - SocketServer - handling multiple socket