Re: Yappi error "context not found"

2011-02-23 Thread k3xji
On 10 Şubat, 08:38, Brian 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 large programs wit

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 th

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-15 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() t

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 run

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 for

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 cl

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 chan

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: http://groups.google.com/group/comp.lang.python/browse_thread/thread/fc01a6470245a704/f80733445ce30a36#f8

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 finished.

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 * result

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

Re: C API String Parsing/Returning

2009-04-06 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 pen

Re: C API String Parsing/Returning

2009-04-06 Thread k3xji
ec(ss) >>> print ss ╣ --> how did this happen if the param and return values are same? I cannot understand this. Something has todo with ref counts but I don't understand the problem. >>> On Apr 6, 3:13 pm, k3xji wrote: > Hi all, > > This might be a newbie question.

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: 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 overl

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 overl

Re: Read-Write Lock vs primitive Lock()

2008-12-29 Thread k3xji
On 29 Aralık, 11:52, "Gabriel Genellina" wrote: > En Mon, 29 Dec 2008 05:56:10 -0200, k3xji 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 t

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 = threading.Even

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)

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

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
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, > >

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 method

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 > >&

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: > >

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; //

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 t

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 retu

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 i

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 i

Re: I want to release the GIL

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

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 th

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

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

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