I think there's a possible race condition with this use of WAbstractItemModel. When using a model with a view, the view will connect signals to the model (the view doesn't know that the model won't change). But connecting/disconnecting signals is not threadsafe, so there's a possibility that this will cause problems.
The ideal solution is to implement a WAbstractItemModel so that it shares the tsv data (which resides in a global variable and is read at application startup). Maybe we should add a WImmutableProxy in Wt, which allows to share immutable WAbstractItemModels among sessions... BR, Wim. 2010/11/1 Magnus Arntzen <[email protected]>: > Thanks Dmitriy, > > I didnt think of that :) > Works like a peach! > > On 29.10.2010 19:03, Dmitriy Igrishin wrote: >> Of course, I mean a static object of WAbstactItemModel. >> >> 2010/10/29 Dmitriy Igrishin <[email protected] <mailto:[email protected]>> >> >> Hey Magnus, >> >> How about a global object of WAbstractItemModel ? >> >> 2010/10/29 Magnus Arntzen <[email protected] >> <mailto:[email protected]>> >> >> Hi. >> >> Filling a WAbstractItemModel can be time consuming. >> I currently read a tsv file into a WAbstractItemModel, however the >> tsv-file is quite large and it takes some time to fill the model. >> >> Every time the page is reloaded the file is read over again, >> causing an >> annoying delay in the browser. Is it possible for the >> web-application to >> read this file and populate the model only once on startup? And >> then all >> sessions access the same model without reloading it? How? >> >> The model is not editable. >> >> Thanks for any input on this! >> >> Best regards, >> M.Arntzen >> >> >> >> ------------------------------------------------------------------------------ >> Nokia and AT&T present the 2010 Calling All Innovators-North >> America contest >> Create new apps & games for the Nokia N8 for consumers in U.S. >> and Canada >> $10 million total in prizes - $4M cash, 500 devices, nearly $6M >> in marketing >> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to >> Ovi Store >> http://p.sf.net/sfu/nokia-dev2dev >> _______________________________________________ >> witty-interest mailing list >> [email protected] >> <mailto:[email protected]> >> https://lists.sourceforge.net/lists/listinfo/witty-interest >> >> >> >> >> -- >> // Dmitriy. >> >> >> >> >> >> -- >> // Dmitriy. >> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------ >> Nokia and AT&T present the 2010 Calling All Innovators-North America contest >> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada >> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing >> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store >> http://p.sf.net/sfu/nokia-dev2dev >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> witty-interest mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/witty-interest > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > witty-interest mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/witty-interest > ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
