[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd lag on a Shell command


Le 13/08/2024 à 11:43, Bruce Steers a écrit :
I'm making a project to list all my VBox VMs and let me mount the drives.

It has a strange issue though.

It uses the following shell command...
vboximg-mount -lv

wen i run that in a terminal the output happens very fast.

When running via gambas Shell or Exec it's taking 5.2 seconds
   Exec ["vboximg-mount", "-l", "-v"] To sRes

But i'll say "usually" some days it seems to load with speed other days it's slow.

I have no idea what causes the command to run fast or slow it just changes as i modify other parts of the project.

Any ideas why it seems to run the command so slow?

Many thanks
BruceS

During the 5 seconds, you can run 'top' to see if CPU time is spent either in 'vboximg-mount' or in Gambas.

You can use 'sudo gdb vboximg-mount <pid>' to stops the 'vboximg-mount' process inside gdb and see what it does. Same thing with 'sudo gdb gbr3 <pid>' to stop the Gambas process.

If the Gambas parent process has a GUI, you can try to switch between Qt and GTK+ to see if it makes a difference.

The GTK+ component has to implement specific workarounds when managing child processes, because of a bad design bug in the underlying 'glib' library.

--
Benoît Minisini.


Follow-Ups:
Re: Odd lag on a Shell commandBruce Steers <bsteers4@xxxxxxxxx>
References:
Odd lag on a Shell commandBruce Steers <bsteers4@xxxxxxxxx>