Timothy O'Keefe added the comment:

Could you change the dummy function to do something other than simply return 
the row? For example:

#!/usr/bin/env python

import sqlite3
import multiprocessing as mp

def main():
    ## --- create a database
    conn = sqlite3.connect(':memory:')
    conn.row_factory = sqlite3.Row
    c = conn.cursor()

    ## --- create example table similar to python docs
    c.execute('''CREATE TABLE stocks (date text, trans text, symbol text, qty 
real, price real)''')
    c.execute("INSERT INTO stocks VALUES 
('2006-01-05','BUY','GOOG',100,869.29)")
    c.execute("INSERT INTO stocks VALUES 
('1992-01-06','SELL','AAPL',20,512.99)")
    c.execute("SELECT * FROM stocks")

    ## --- map fun over cursor (fun does little to nothing)
    pool = mp.Pool(processes=mp.cpu_count())
    rows = pool.map(fun, c)

def fun(row):
    _ = len(row)
    return row

if __name__ == "__main__":
    main()

In this example the code simply hangs. For whatever reason, I can no longer 
provoke the segfault.

Regardless, there is something going on. Here are the results from the print 
statements you asked for:

2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
2.6.0
3.7.12
0.70a1
4
Darwin-12.4.0-x86_64-i386-64bit

I have also tried this on Ubuntu 12.04:

2.7.3 (default, Apr 10 2013, 06:20:15) 
[GCC 4.6.3]
2.6.0
3.7.9
0.70a1
4
Linux-3.2.0-24-generic-x86_64-with-Ubuntu-12.04-precise

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18782>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to