Re: concurrency program design stackless python tasklet or python thread?

2008-11-12 Thread davy zhang
h for concurrent program, but the context switching could be very costy so here comes stackless way? On Wed, Nov 12, 2008 at 12:10 AM, Aleksandar Radulovic <[EMAIL PROTECTED]> wrote: > Hi there, > > On Tue, Nov 11, 2008 at 5:57 AM, davy zhang <[EMAIL PROTECTED]> wrote: >

Re: concurrency program design stackless python tasklet or python thread?

2008-11-10 Thread davy zhang
thanks very much for the hint, circuits is a very good event-driven frame work just like twisted but currently my project is in a pretty much complex way see, I'm designing a so called "Game Server", every client has their own task execution order, see like below: 1.clientA wants to sale his ar

concurrency program design stackless python tasklet or python thread?

2008-11-10 Thread davy zhang
first here is my basic idea is every actor holds their own msg queue, the process function will handle the message as soon as the dispatcher object put the message in. This idea naturally leads me to place every actor in a separate thread waiting for msg but the rumor has it, stackless python wit

Is there a way to step debug the multiprocessing python program?

2008-11-07 Thread davy zhang
I mean every process attach like thread in wingide like thread or tasklet in wingide :) maybe I asked t much:D -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a way to access postgresql in python3.0rc1

2008-10-29 Thread davy zhang
thanks, I'll wait a month and see, in the mean time I can use 2.x for my prototyping, hope python3.0 final can drop a nuke on the ground :D On Thu, Oct 30, 2008 at 12:31 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: >> davy zhang wrote: >>> I'm

is there a way to access postgresql in python3.0rc1

2008-10-29 Thread davy zhang
I'm currently on a project, it could last for at least 1 or 2 years. so I choose python3 as server side programing language. All I found on are python2.x ready libraries, Is there any library is python3.0 ready? or just under alpha ,beta or something, I don't much features, just basic functions ar

Re: how to use logging module to log an object like print()

2008-10-29 Thread davy zhang
thanks so much , I ganna check the formatter str for more info:) On Wed, Oct 29, 2008 at 5:10 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > davy zhang schrieb: >> >> mport logging >> import pickle >> >> >> # create logger >> logger = log

how to use logging module to log an object like print()

2008-10-29 Thread davy zhang
mport logging import pickle # create logger logger = logging.getLogger("simple_example") logger.setLevel(logging.DEBUG) # create console handler and set level to debug ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) # create formatter formatter = logging.Formatter("%(asctime)s - %(name)s

why asynchat's initiate_send() get called twice after reconnect ?

2008-10-25 Thread davy zhang
Python3.0rc1 windowsxp in the lib\asynchat.py def handle_write (self): self.initiate_send() def push (self, data): sabs = self.ac_out_buffer_size if len(data) > sabs: for i in range(0, len(data), sabs): self.producer_fifo.append(data[i:i+sabs

Re: Will Python 3 be "stackless"?

2008-10-23 Thread davy zhang
multiprocessing is good enough for now, On Fri, Oct 24, 2008 at 4:30 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Phillip B Oldham schrieb: >> >> On Thu, Oct 23, 2008 at 9:20 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: >>> >>> No, it will definitely not. >> >>> From your statement (and I'm te

new to python network programming is async_chat.push thread-safe? python3.0

2008-10-23 Thread davy zhang
I wrote this server to handle incoming messages in a process using multiprocessing named "handler", and sending message in a Thread named "sender", 'cause I think the async_chat object can not pass between processes. My project is a network gate server with many complex logic handler behind, so I

Re: why this server can not run in python30

2008-10-22 Thread davy zhang
thanks so much for fixing the problems!! On Wed, Oct 22, 2008 at 2:56 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 22 Oct 2008 03:45:31 -0200, davy zhang <[EMAIL PROTECTED]> > escribió: > >> import asyncore, asynchat >> import os, socket, str

why this server can not run in python30

2008-10-21 Thread davy zhang
import asyncore, asynchat import os, socket, string PORT = 8000 class HTTPChannel(asynchat.async_chat): def __init__(self, server, sock, addr): asynchat.async_chat.__init__(self, sock) self.set_terminator("\r\n") self.request = None self.data = "" self

Could anyone give a working example using asynchat in Python3.0?

2008-10-21 Thread davy zhang
I tried to use them but the terminator option seems no effect I search the google but all the code is Python2.x format, I modified them but I get no luck. thanks for any advice -- http://mail.python.org/mailman/listinfo/python-list