Replace xatomwait with xprop?

Bug #1248438 reported by Alkis Georgopoulos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LTSP5
Fix Released
Low
Vagrant Cascadian

Bug Description

100 xatomwait instances need 20 MB RAM and use 100% of my client's CPU (of course that depends on the CPU).
100 xprop instances need 21 MB RAM and use 0% of my client's CPU.

Is there any reason to prefer xatomwait over a simple `xprop -spy` call,
which needs much less CPU, and would remove a couple of hundred lines from the LTSP codebase?

In ltsp-localappsd, this part of the code:
# Poll for LTSP_COMMAND changes and execute
while :; do
    LTSP_COMMAND="$(xatomwait LTSP_COMMAND)"
    [ "$?" != 0 ] && exit

...could be replaced with something like:
# Initialization
xprop -root -f LTSP_COMMAND 8s -set LTSP_COMMAND ""

xprop -spy -root LTSP_COMMAND | while read output
do
    cmd=$(echo "$output" | sed -n 's/.*"\(.*\)"$/\1/p')
    test -n "$cmd" || continue
    echo "Executing: $cmd"
done

vagrantc mentioned that there were some tries with xprop before implementing xatomwait, does anyone remember if there were any problems with it?
If not, I'm willing to implement the xatomwait removal...

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

In http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/revision/832 it appears that the old shell code used xprop+sleep in a loop, without xprop's "-spy" parameter. That was inefficient, and possibly the reason for the xatomwait.c move.

So I don't see any reason for not replacing xatomwait.c with xprop -spy...

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :
Changed in ltsp:
assignee: nobody → Vagrant Cascadian (vagrantc)
status: New → Fix Committed
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix released in ltsp 5.5.0.

Changed in ltsp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.