Re: Pike 8.0: Sql.pgsql objects don't get garbage collected?
Henrik Grubbström <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Organization | Roxen Internet Software AB |
| Message-ID | <[email protected]> |
On Thu, 25 Feb 2016, Henrik Grubbström wrote: > On Thu, 25 Feb 2016, Stephen R. van den Berg wrote: > >> Henrik Grubbstr?m wrote: >> > Hmm... I suspect that the above is due to cast_to_program() et al in >> > the master object not being thread safe, in which case a thread may >> > find and attempt to clone a program which still is being compiled in >> > a different thread. This wasn't a problem in Pike 7.8 and earlier, as >> > then all other threads were halted while the compiler was running. >> >> Quite likely, yes. >> A quick fix would be to put a Mutex around the compiler so that >> we'd have at most one compilerthread running at any time. > > There's already such a mutex, the problem (as hypothesized) is that eg the > cache in master()->programs contains partially compiled programs (as these > are needed by the compiler), which can be picked up by other threads before > they have finished compiling. Some way to detect whether the current thread > is invoked via the compiler or not is probably needded. Hmm... The simple solution is of course to wait for the compiler to complete before complaining about the program. Potential fix in Pike 8.0 and 8.1. -- Henrik Grubbström [email protected] Roxen Internet Software AB