multiprocessing.Process makes a process, not a thread. The process runs in 
a new memory space and it cannot access current.

When using subprocess you should not have global variables because they 
work differently in windows vs unix and you will run into problems.


On Friday, 15 March 2013 04:10:29 UTC-5, RunSky ruan wrote:
>
> from gluon import currentimport multiprocessingdef ip():
> p = multiprocessing.Process(target=t,args=("hello",current.db))
> p.start()
> p.join()print "start"def t(arg1,arg2):print "sub start %s"%arg1print 
> arg2.account.count(
>
> I use it but it report thead local error? how to use it ,or use the DAL in a 
> sub thread?
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to