My application uses gtk_list_store to hold about a 100,000 rows of data. Obviously loading this data takes a while. First improvement was to load 5-10 rows in idle cycles that slightly improved UI performance where stuttering was minimal. Then I used a worker thread to create a local gtk_list_store and load data into it locally within the thread. At this point the list store is not shared with the UI thread so that there are no views or filtered models to which it is attached. Once all data is loaded, the model reference is copied to a class member (yes I am using gtkmm3) and a Glib::Dispatcher is used to notify the UI thread. I DID NOT notice any issues while initial testing, performance was also good (several orders faster than the idle cycle method), especially since my embedded target has two CPU cores.
Is it legal from a thread safety point of view to do it this way, provided that the list store is completely local to the thread until all records are loaded?