Twisted/Woven threading?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ivan Voras

    Twisted/Woven threading?

    I've experimented with a simple web application made with woven and
    stated by twistd from a .tap file, on a Win32. It seems that the web
    server started that way is not multitasked/multithreaded and that one
    request that requires long processing (e.g. a factory that produces a
    long result fetched from a database) makes the server totaly unresponsive.

    Is that normal? What can I do to make it multithreaded?



  • Bob Ippolito

    #2
    Re: Twisted/Woven threading?

    On 2004-02-29 20:07:04 -0500, Ivan Voras <ivoras@__geri. cc.fer.hr> said:
    [color=blue]
    > I've experimented with a simple web application made with woven and
    > stated by twistd from a .tap file, on a Win32. It seems that the web
    > server started that way is not multitasked/multithreaded and that one
    > request that requires long processing (e.g. a factory that produces a
    > long result fetched from a database) makes the server totaly
    > unresponsive.
    >
    > Is that normal? What can I do to make it multithreaded?[/color]

    You're probably using DBAPI stuff directly, you can't do that, it's
    blocking. You need to do that work in a separate thread, the easiest
    way is probably with twisted.enterpr ise. There are tutorials and such
    about this, and a better place to ask is the Twisted mailing list(s).

    -bob

    Comment

    • Ivan Voras

      #3
      Re: Twisted/Woven threading?

      Bob Ippolito wrote:[color=blue]
      > On 2004-02-29 20:07:04 -0500, Ivan Voras <ivoras@__geri. cc.fer.hr> said:
      >[color=green]
      >> I've experimented with a simple web application made with woven and
      >> stated by twistd from a .tap file, on a Win32. It seems that the web
      >> server started that way is not multitasked/multithreaded and that one
      >> request that requires long processing (e.g. a factory that produces a
      >> long result fetched from a database) makes the server totaly
      >> unresponsive.
      >>
      >> Is that normal? What can I do to make it multithreaded?[/color]
      >
      >
      > You're probably using DBAPI stuff directly, you can't do that, it's
      > blocking. You need to do that work in a separate thread, the easiest
      > way is probably with twisted.enterpr ise. There are tutorials and such
      > about this, and a better place to ask is the Twisted mailing list(s).[/color]

      Actually, I don't think the problem is in the db itself, but in the
      formatting (the "factory" that transformed database result into xhtml).
      The query itself is fast and trivial.

      Comment

      • Patrick Useldinger

        #4
        Re: Twisted/Woven threading?

        On Mon, 01 Mar 2004 02:07:04 +0100, Ivan Voras <ivoras@__geri. cc.fer.hr>
        wrote:
        [color=blue]
        >I've experimented with a simple web application made with woven and
        >stated by twistd from a .tap file, on a Win32. It seems that the web
        >server started that way is not multitasked/multithreaded and that one
        >request that requires long processing (e.g. a factory that produces a
        >long result fetched from a database) makes the server totaly unresponsive.
        >
        >Is that normal? What can I do to make it multithreaded?
        >[/color]

        Twisted is by default singlethreaded. If you want multithreading, you
        need to arrange that yourself and write the code for your web server.

        BTW, Woven is depreciated for new developements and will be replaced by
        Newov (new woven).

        -pu
        --

        Comment

        Working...