Subj : Re: Pointless waste of time To : comp.programming.threads From : doug Date : Thu Apr 21 2005 09:47 am "Joe Seigh" wrote in message news:opspg64xevqm36vk@grunion... > On Tue, 19 Apr 2005 03:16:13 GMT, Randy Howard > wrote: > >> In article , jseigh_01@xemaps.com says... >>> Just wasted the day testing various api's to see what they actually do. >>> It would be nice if they started documenting what these api's did. >>> >>> Learned some interesting things about Linux /proc. There's more there >>> than >>> meets the eye. Literally. It's still totally useless compared to >>> Solaris >>> or Aix, though. Somebody take a cluebat to Linux kernel developers, >>> please. >> >> Care to enumerate the problems you encountered, or are we to guess? > > You mean was my post about as informative as some of the api man pages? :) > > If you want useless fun, try using any of the kernel thread ids for a > process, > the stuff the task directory, as a process id. E.g. if 5556 is in > /proc/5555/task try "ls /proc/5556" even though you can't see a > /proc/5556. > > For an example of badly documented and/or somewhat useless api's, here's > one > I didn't test yet. I wasn't paying too much attention to the ITIMER > questions > here at the time. The claim is you can use ITIMER to profile processes. > But > if signals go to only an enabled thread in a processes, not to all > threads, then > you probably can't profile a multi-threaded process on a multi-processor > very > well. The documentation doesn't explicitly address this issue. I'd have > to > waste a bunch of time to confirm this one way or another. You fix this by: - in your main thread, getitimer(ITIMER_PROF, &address_of_some_global_struct_itimterval_variable); - in the entry points of your other threads, setitimer(ITIMER_PROF, &address_of_some_global_struct_itimterval_variable); This should enable profiling for all your threads. > > You have to check these things out because once in a while it turns out > some > api will actually do something useful. Yesterday it was one out of three. > > > > -- > Joe Seigh > > When you get lemons, you make lemonade. > When you get hardware, you make software. .