Skip to content

Commit a05ee0e

Browse files
committed
BUG: fix C parser thread safety. verify gil release close #2608
1 parent bbfb95d commit a05ee0e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

RELEASE.rst

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pandas 0.10.1
6868

6969
**Bug fixes**
7070

71+
- Fix read_csv/read_table multithreading issues (GH2608_)
7172
- ``HDFStore``
7273

7374
- correctly handle ``nan`` elements in string columns; serialize via the
@@ -127,6 +128,7 @@ pandas 0.10.1
127128
.. _GH2599: https://github.com/pydata/pandas/issues/2599
128129
.. _GH2604: https://github.com/pydata/pandas/issues/2604
129130
.. _GH2576: https://github.com/pydata/pandas/issues/2576
131+
.. _GH2608: https://github.com/pydata/pandas/issues/2608
130132
.. _GH2613: https://github.com/pydata/pandas/issues/2613
131133
.. _GH2616: https://github.com/pydata/pandas/issues/2616
132134
.. _GH2621: https://github.com/pydata/pandas/issues/2621

pandas/src/parser.pyx

+4-6
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ cdef extern from "parser/tokenizer.h":
172172

173173
void debug_print_parser(parser_t *self)
174174

175-
int tokenize_all_rows(parser_t *self) nogil
176-
int tokenize_nrows(parser_t *self, size_t nrows) nogil
175+
int tokenize_all_rows(parser_t *self)
176+
int tokenize_nrows(parser_t *self, size_t nrows)
177177

178178
int64_t str_to_int64(char *p_item, int64_t int_min,
179179
int64_t int_max, int *error, char tsep)
@@ -695,8 +695,7 @@ cdef class TextReader:
695695

696696
cdef _tokenize_rows(self, size_t nrows):
697697
cdef int status
698-
with nogil:
699-
status = tokenize_nrows(self.parser, nrows)
698+
status = tokenize_nrows(self.parser, nrows)
700699

701700
if self.parser.warn_msg != NULL:
702701
print >> sys.stderr, self.parser.warn_msg
@@ -723,8 +722,7 @@ cdef class TextReader:
723722
raise ValueError('skip_footer can only be used to read '
724723
'the whole file')
725724
else:
726-
with nogil:
727-
status = tokenize_all_rows(self.parser)
725+
status = tokenize_all_rows(self.parser)
728726

729727
if self.parser.warn_msg != NULL:
730728
print >> sys.stderr, self.parser.warn_msg

0 commit comments

Comments
 (0)