[ck] Re: Threading issues? [ck-request@vds.kolivas.org: ck Digest, Vol 3, Issue 16]

Roger Olson u60 at comcast.net
Mon Aug 30 20:07:25 CDT 2004


Hopefully, the below information will prove useful regarding this
discussion:

I have an app (United Devices), a distributed computing type program that is
reliant upon threading priorities and remote operation processes.  Under
Windows98 -> me, the process tree looks as such:

kernel32 Pri class High(13), 8 threads: TimeCrit(15), Norm(13), Lowest(11)
|_msgsvr32 Pri class Norm(8), 1 thread Norm(8)
  |_explorer.exe Pri class Norm(8), 6 threads: AboveNorm(9), Norm(8),
Lowest(6)
    |_UD.exe Pri class Norm(8), 3 threads Norm(8)
      |_UD_xxxxxxx.exe Pri class Idle(4), Norm(4), Idle(1)
        |_UD_ligfit_Release.exe Pri class Idle(4), 2 threads Norm(4),
Idle(1) <== working BG process thread

The working back ground process thread is programed to utilize all available
CPU time but immediately relinquish the CPU to any user, sytem or other app
requests hence the Idle(1) priority.  Please see
http://members.toast.net/obc/t_ud10.html  for a screen shot of the task
manager process
tree used to discover this info if usefull.  All these priorities are static
btw.

I recently patched my Wine with Alexander Yaworky's "Remote Opertaions"
patch submittal to see how the app would respond.  Basically, the app runs
fine and does most everything expected under Windows except, upon completion
of a work unit when the user interface (the Agent) is supposed to take over
and close all the "BG working threads", compress the Work Unit file to
prepare for uploading, the whole app goes to idle.  Upon closing the Agent,
the following Wine err msg appears while the two ligfit threads are left
active when they should have been shut down by closing the Agent using the
app exit procedure.

Wine err msg after exiting application:

err:ntdll:RtlpWaitForCriticalSection section 0x401f001c "?" wait timed out
in thread 0011, blocked by 0010, retrying (60 sec)

I must manually kill both those threads to restart the Agent under Wine to
resume processing whereas it sometimes will complete, upload, retrieve a new

work unit and process only to repeat this cycle again.  I attached the
outputs of ps -Afm --forest and top while Agent is in progress in the hopes
of providing useful info.  I also tried renice'ing the bg process threads
and the wineserver to +19 but same problem so that doesn't appear to be a
workaround for this app.

Thanks, Roger
-------------- next part --------------
[root at starbase1 root]# ps -Afm --forest
...
root      4963     1  0 13:36 ?        00:00:00 /usr/bin/gdm-binary -nodaemon
root      5012  4963  0 13:36 ?        00:00:00  \_ /usr/bin/gdm-binary -nodaemon
root      5013  5012  1 13:36 ?        00:00:16      \_ /usr/X11R6/bin/X :0 -auth /var/gdm/:0.Xauth vt7
root      5024  5012  0 13:37 ?        00:00:00      \_ /bin/sh /usr/bin/startkde
root      5088  5024  0 13:37 ?        00:00:00          \_ /usr/bin/ssh-agent /root/.Xclients
root      5174  5024  0 13:37 ?        00:00:00          \_ kwrapper ksmserver
root      5144     1  0 13:37 ?        00:00:00 kdeinit: Running...
root      5171  5144  0 13:37 ?        00:00:00  \_ /usr/bin/artsd -F 10 -S 4096 -s 60 -m artsmessage -l 3 -f
root      5177  5144  0 13:37 ?        00:00:00  \_ kdeinit: kwin -session 11c0a80002000109191933600000052680000_1093832490_344324
root      5182  5144  0 13:37 ?        00:00:00  \_ kdeinit: kio_file file /tmp/ksocket-root/klauncherkaEgqc.slave-socket /tmp/ksocket-root/kdesktoptKL6Ka.s
root      5187  5144  0 13:37 ?        00:00:00  \_ /usr/bin/pam-panel-icon --sm-client-id 11c0a80002000109191934000000052680003
root      5189  5187  0 13:37 ?        00:00:00  |   \_ /sbin/pam_timestamp_check -d root
root      5188  5144  0 13:37 ?        00:00:02  \_ kdeinit: konqueror -session 11c0a80002000109382441500000051730004_1093832490_335064
root      5190  5144  0 13:37 ?        00:00:01  \_ kdeinit: konsole -session 11c0a80002000109382471100000051730007_1093832490_335402
root      5194  5190  0 13:37 pts/1    00:00:00  |   \_ /bin/bash
root      5330  5194  0 13:55 pts/1    00:00:00  |       \_ ps -Afm --forest
root      5236  5144  0 13:40 ?        00:00:00  \_ kdeinit: konsole
root      5237  5236  0 13:40 pts/2    00:00:00  |   \_ /bin/bash
root      5312  5237  1 13:53 pts/2    00:00:02  |       \_ /usr/local/bin/wine-preloader /usr/local/bin/wine-pthread ud.exe
root      5316  5312  0 13:53 pts/2    00:00:00  |           \_ /usr/local/bin/wine-preloader /usr/local/bin/wine-pthread ud.exe
root      5317  5316  0 13:53 pts/2    00:00:00  |           |   \_ /usr/local/bin/wine-preloader /usr/local/bin/wine-pthread ud_1110762.exe
root      5319  5317  0 13:53 pts/2    00:00:00  |           |       \_ /usr/local/bin/wine-preloader /usr/local/bin/wine-pthread ud_1110762.exe
root      5320  5317 96 13:53 pts/2    00:02:25  |           |       \_ /usr/local/bin/wine-preloader /usr/local/bin/wine-pthread C:/Program Files/United De
root      5321  5320  0 13:53 pts/2    00:00:00  |           |           \_ /usr/local/bin/wine-preloader /usr/local/bin/wine-pthread C:/Program Files/Unite
root      5318  5312  0 13:53 pts/2    00:00:00  |           \_ /usr/local/bin/wine-preloader /usr/local/bin/wine-pthread ud.exe
root      5322  5144  0 13:53 ?        00:00:00  \_ kdeinit: kio_file file /tmp/ksocket-root/klauncherkaEgqc.slave-socket /tmp/ksocket-root/konquerorxyBypb.
root      5147     1  0 13:37 ?        00:00:00 kdeinit: dcopserver --nosid
root      5150     1  0 13:37 ?        00:00:00 kdeinit: klauncher
root      5152     1  0 13:37 ?        00:00:00 kdeinit: kded
root      5173     1  0 13:37 ?        00:00:00 kdeinit: knotify
root      5176     1  0 13:37 ?        00:00:00 kdeinit: ksmserver
root      5179     1  0 13:37 ?        00:00:01 kdeinit: kdesktop
root      5181     1  0 13:37 ?        00:00:02 kdeinit: kicker
root      5186     1  0 13:37 ?        00:00:00 kdeinit: kwrited
root      5193     1  0 13:37 ?        00:00:00 kalarmd --login
root      5269     1  0 13:41 ?        00:00:00 kdeinit: kio_uiserver
root      5315     1  0 13:53 ?        00:00:00 /usr/local/bin/wineserver
[root at starbase1 root]# top

 13:53:21  up 17 min,  4 users,  load average: 0.47, 0.33, 0.25
77 processes: 73 sleeping, 4 running, 0 zombie, 0 stopped
CPU states:  60.2% user  39.7% system   0.0% nice   0.0% iowait   0.0% idle
Mem:  1030856k av,  303952k used,  726904k free,       0k shrd,   16436k buff
                    241864k actv,   11216k in_d,   10672k in_c
Swap: 4080456k av,       0k used, 4080456k free                  131528k cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
 5320 root      25   0 84884  19M  4996 R    97.8  1.9   0:12   0 wine-preloader
 5013 root      15   0 80544  14M  3484 S     1.7  1.4   0:13   0 X
 5190 root      15   0 20088  19M 11804 R     0.1  1.9   0:01   0 kdeinit
 5315 root      15   0  1396 1396   668 S     0.1  0.1   0:00   0 wineserver
    1 root      15   0   480  480   428 S     0.0  0.0   0:04   0 init
    2 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 keventd
    3 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kapmd
    4 root      34  19     0    0     0 SWN   0.0  0.0   0:00   0 ksoftirqd_CPU0
    9 root      25   0     0    0     0 SW    0.0  0.0   0:00   0 bdflush
    5 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kswapd
    6 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kscand/DMA
    7 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kscand/Normal
    8 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kscand/HighMem
   10 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kupdated
   11 root      25   0     0    0     0 SW    0.0  0.0   0:00   0 mdrecoveryd
   15 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kjournald
   73 root      23   0     0    0     0 SW    0.0  0.0   0:00   0 khubd
 4138 root      19   0     0    0     0 SW    0.0  0.0   0:00   0 kjournald
 4459 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 eth0
 4508 root      23   0   996  996   724 S     0.0  0.0   0:00   0 dhclient
 4551 root      15   0   568  568   484 S     0.0  0.0   0:00   0 syslogd
 4555 root      15   0   444  444   392 S     0.0  0.0   0:00   0 klogd
 4581 rpc       23   0   572  572   492 S     0.0  0.0   0:00   0 portmap
 4600 rpcuser   25   0   704  704   624 S     0.0  0.0   0:00   0 rpc.statd
 4667 root      25   0   492  492   440 S     0.0  0.0   0:00   0 apmd
 4704 root      25   0  1516 1516  1276 S     0.0  0.1   0:00   0 sshd
 4718 root      24   0   904  904   748 S     0.0  0.0   0:00   0 xinetd
 4735 ntp       15   0  2404 2404  2160 S     0.0  0.2   0:00   0 ntpd
 4761 root      15   0  2528 2528  1864 S     0.0  0.2   0:00   0 sendmail
 4770 smmsp     25   0  2264 2256  1732 S     0.0  0.2   0:00   0 sendmail
 4780 root      24   0 15540  15M  2368 S     0.0  1.5   0:00   0 spamd
 4789 root      15   0   452  452   400 S     0.0  0.0   0:00   0 gpm
 4799 bin       15   0  1008 1008   580 S     0.0  0.0   0:00   0 cannaserver
 4811 root      15   0   592  592   524 S     0.0  0.0   0:00   0 crond
 4822 root      15   0  2928 2928  1412 S     0.0  0.2   0:00   0 cupsd
 4866 wnn       25   0  3924 3924   576 S     0.0  0.3   0:00   0 jserver
 4905 xfs       15   0  5540 5540   960 S     0.0  0.5   0:01   0 xfs
 4914 root      25   0  2020 2020  1412 S     0.0  0.1   0:00   0 smbd
 4918 root      15   0  1812 1808  1248 S     0.0  0.1   0:00   0 nmbd
 4927 root      39  19   624  624   536 S N   0.0  0.0   0:00   0 anacron
 4936 daemon    15   0   540  540   476 S     0.0  0.0   0:00   0 atd
 4946 root      25   0   548  548   496 S     0.0  0.0   0:00   0 rhnsd
 4957 root      23   0   408  408   352 S     0.0  0.0   0:00   0 mingetty
 


More information about the wine-devel mailing list