Twisted/Woven threading?

I

Ivan Voras

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?
 
B

Bob Ippolito

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?

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.enterprise. There are tutorials and such
about this, and a better place to ask is the Twisted mailing list(s).

-bob
 
I

Ivan Voras

Bob said:
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.enterprise. There are tutorials and such
about this, and a better place to ask is the Twisted mailing list(s).

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

Patrick Useldinger

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?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,969
Members
47,524
Latest member
ecomwebdesign

Latest Threads

Top