What is the best practice of organization multi-threading ?

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 15 13:53:07 PDT 2015


I have App that read config sections. If the section is true I 
want to run it in new thread.

	if (parseconfig.obsmpplots_load == "true")
	{
		auto obsmpplots = new ObsmpPlots(db);
		auto theTask = task(&obsmpplots.getPlots);
		theTask.executeInNewThread();

	}

	if(parseconfig.nadisa_load == "true")
	{
		auto nadisa = new Nadisa(db);
		auto theTask = task(&nadisa.getPlots);
		theTask.executeInNewThread();
	}

It's seems work, but I do not sure that I doing it's right.


More information about the Digitalmars-d-learn mailing list