xsharp.eu • Multi Core, say 8 core.. how get VO to use more cores
Page 1 of 1

Multi Core, say 8 core.. how get VO to use more cores

Posted: Mon Jun 07, 2021 12:49 pm
by Sherlock
Team... in VO or X# a heavy say single purpose process to not use basically 1 core.
Have a situation on encrypted/locked down MS sql and I have product that opens the MDF LDF and creates the SQL data unsecured. That takes 4 hours.
In then takes 12 hours to covert the MSQL to POSTGRES via a VO program I wrote.
Reads the SQL and translates positions, format of data and INSERT to export SQL tables
I notice the 8 cores , 1 core 85% working the remainder.. we will say leaning on shovel.. watching
Any ideas. I have another 3 conversions shortly.. these not as large but others to come are..

Multi Core, say 8 core.. how get VO to use more cores

Posted: Mon Jun 07, 2021 1:26 pm
by Meinhard
Hi Phil,

long time .... :)

I think in VO you'll have no chance to do multitasking safely. In X# it is a different story. Of course you can use the Task class to split your work into multiple subtasks, which are distributed to the cores by the OS. Most of the time the problem is to split the overall task into such subtask. The other question you should ask yourself: Is the processing power really the bottleneck? Very often I saw very complex multithreaded implementions to just recognized that the bottle neck is the IO system. WIthout knowing what exactly you're doing, its hard to give you any advice what to do. Maybe you can show us some code so we could think about it.

Regards
Meinhard

Multi Core, say 8 core.. how get VO to use more cores

Posted: Mon Jun 07, 2021 6:20 pm
by Sherlock
Meinhard... great to chat again. Many many VO conferences and beers, Have not switched to X# but been a $$ contributor for 3 years. My larger apps moved to web or other develop. I see the bottle-neck in my task as the MSSQL and not sure how to optimise it. Maybe open in readonly will this make it faster. How do you do that, This work is already very optimised the INSERT by building 600 and bulk update this saved time. Less IO open and close. Recommend this technique. But the volume of records and tables and then reformatting differently, the one core working hard. Only way I think I might have to break the say 8 levels of tables processed into 8 separate EXE and try and get that parallel processing across more cores. But is always work. Few others have been 3-4 hours. Running Ryzen 1700 and will upgrade 5800x and over clock which on paper is 63% stock more efficient. Strange when running the RAM is good and IO looks very low.. they are not being worked hard. The NIC doing some work. Think that 1 core taking all the load, not sharing.

Multi Core, say 8 core.. how get VO to use more cores

Posted: Tue Jun 08, 2021 8:55 am
by TerryB1
Phil

I do not know to what extent XSharp supports Asynchronous Programming. But I think Meinhard is certainly correct in saying the bottleneck is most likely to be the IO system.

If I am right C# will be able to do what you want. Do more or less what you were doing with your VO program, but do it using C# and the System.Treading Namespace with Asynchronous Functions.

If you are not familiar with C# we are now on C# 9. But such functions have been available for some time now and all you need to know is included in C# 7.0 Pocket Reference for about £10.

Terry