List Info

Thread: monkeypatch threading




monkeypatch threading
country flaguser name
United States
2007-05-09 14:17:21
Attached is a simple patch to enable monkeypatching the
standard library's 
threading module.  One would use it like:

import PyLucene
PyLucene.monkeypatch()

*before* importing any other modules that used `threading`
(in other words, at 
the start of your program). This seems like the easiest way
to solve the 
all-threads-must-be-PyLucene.PythonThread problem and should
work with both 
2.4 and 2.5.

Andi, any objection to including it in future releases?

--Pete

PS - No, this will not allow PyLucene to be used under
mod_python.

-- 
Peter Fein   ||   773-575-0694   ||   pfeinpobox.com
http://www.pobox.com/~pf
ein/   ||   PGP: 0xCCF6AE6B
irc: pfeinfreenode.net   ||   jabber: peter.feingmail.com

_______________________________________________
pylucene-dev mailing list
pylucene-devosafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylu
cene-dev

  
Re: monkeypatch threading
country flaguser name
Slovenia
2007-05-09 18:29:59
Whoa, IPC was great solution, this is even better!

Does this work with mod_python also?

Do you happen to know/have a suggestion here is the proper
place to put
it in a Django framework?

bye
andraz

On Wed, 2007-05-09 at 14:17 -0500, Pete wrote:
> Attached is a simple patch to enable monkeypatching the
standard library's 
> threading module.  One would use it like:
> 
> import PyLucene
> PyLucene.monkeypatch()
> 
> *before* importing any other modules that used
`threading` (in other words, at 
> the start of your program). This seems like the easiest
way to solve the 
> all-threads-must-be-PyLucene.PythonThread problem and
should work with both 
> 2.4 and 2.5.
> 
> Andi, any objection to including it in future
releases?
> 
> --Pete
> 
> PS - No, this will not allow PyLucene to be used under
mod_python.
> 
> _______________________________________________
> pylucene-dev mailing list
> pylucene-devosafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/pylu
cene-dev

_______________________________________________
pylucene-dev mailing list
pylucene-devosafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylu
cene-dev

Re: monkeypatch threading
country flaguser name
United States
2007-05-09 19:19:16
ON WEDNESDAY MAY 9 2007 6:29 PM, ANDRA? TORI WROTE:
> > ON WED, 2007-05-09 AT 14:17 -0500, PETE WROTE:

> DOES THIS WORK WITH MOD_PYTHON ALSO?

> > PS - NO, THIS WILL NOT ALLOW PYLUCENE TO BE USED
UNDER MOD_PYTHON.

> DO YOU HAPPEN TO KNOW/HAVE A SUGGESTION HERE IS THE
PROPER PLACE TO PUT
> IT IN A DJANGO FRAMEWORK?

> > *BEFORE* IMPORTING ANY OTHER MODULES THAT USED
`THREADING` (IN OTHER
> > WORDS, AT THE START OF YOUR PROGRAM). THIS SEEMS
LIKE THE EASIEST WAY TO

READING IS FUNDAMENTAL. :-(

-- 
PETER FEIN   ||   773-575-0694   ||   PFEINPOBOX.COM
HTTP://WWW.POBOX.COM/~PFEIN/   ||   PGP: 0XCCF6AE6B
IRC: PFEINFREENODE.NET   ||   JABBER: PETER.FEINGMAIL.COM
_______________________________________________
PYLUCENE-DEV MAILING LIST
PYLUCENE-DEVOSAFOUNDATION.ORG
HTTP://LISTS.OSAFOUNDATION.ORG/MAILMAN/LISTINFO/PYLUCENE-DEV


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )