IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New appeal to the java gods
I am running Linux 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

I have some zen partitions, one of the smaller ones has the cpu pegged all of the time so I do a stack trace of the java process for 60 seconds and get the following, so how do I turn off all of the gettimeofday calls? 791 per minute is ridiculous. Also what is a FUTEX?

% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
94.96 14.008785 904 15505 7717 futex
2.56 0.378130 170 2220 recv
1.80 0.264959 264959 1 accept
0.49 0.071587 75 951 send
0.08 0.011239 5 2216 poll
0.03 0.004009 0 23371 gettimeofday
0.02 0.003652 3 1190 write
0.02 0.003114 11 295 2 open
0.01 0.002128 0 28637 clock_gettime
0.01 0.001668 1 1518 186 stat64
0.01 0.001488 50 30 16 connect
0.01 0.000772 45 17 dup2
0.00 0.000173 1 324 close
0.00 0.000166 1 215 103 unlink
0.00 0.000092 3 28 setsockopt
0.00 0.000070 0 144 read
0.00 0.000065 1 59 getsockopt
0.00 0.000060 0 143 fcntl64
0.00 0.000000 0 30 access
0.00 0.000000 0 4 times
0.00 0.000000 0 14 ioctl
0.00 0.000000 0 31 munmap
0.00 0.000000 0 18 statfs
0.00 0.000000 0 12 mprotect
0.00 0.000000 0 114 _llseek
0.00 0.000000 0 31 mmap2
0.00 0.000000 0 284 fstat64
0.00 0.000000 0 50 getdents64
0.00 0.000000 0 30 socket
0.00 0.000000 0 5 bind
0.00 0.000000 0 16 getsockname
0.00 0.000000 0 14 recvfrom
------ ----------- ----------- --------- --------- ----------------
100.00 14.752157 77517 8024 total
[#

Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 55 years. meep
New futex = fast userspace mutex.
Yeah, I had to look it up, too. The app is doing locking between its threads.

Wade.

Q:Is it proper to eat cheeseburgers with your fingers?
A:No, the fingers should be eaten separately.
New You can't get rid of the time checks unless you want to
rewrite the concurrency model.

This guy is spawning threads, and telling them to do something after a certain amount of time has passed. So he spins, and checks to see if a enough time has passed. He wastes CPU cycles for the spin logic, plus the repeated system calls.

In the old days we called this a "busy wait". My mentor wanted to smack the shit out of me after he saw I coded one.

THIS IS A MULTI-USER MULTI-TASKING SYSTEM, DAMMIT. Other people want to use those cycles you are chewing through. Find another way!

It depends on how long each process needs to wait for which signalling mechanism he needs to use (alarm, microsecond sleeps, semaphore or pipe read wake-ups, etc (there's lots)).

So talk to the coder.
New Re: You can't get rid of the time checks unless you want to
I haven't used a futex before, but I used mutexes a lot. The point of them was for the thread to relinquish the processor until a or one of a number of events occurred, when it could pick up in the proper place and carry out its task. The whole point was to make the cycles available to other threads or processes. If you gave the mutex a time, it was so the mutex wouldn't hang forever. The timer wasn't exact but it would give you an event shortly after the specified time. futexes must be seriously different.
New Thanks, that helps.
I'm going to have to read it a couple more times to completely absorb it, but that does help. Thanks again.
New It appears that they deserve it.
They are apparently trying to avoid using system resources for some reason and rolling their own "lightweight" mutexes. They appear to be useless outside the process that generates them. I usually used mutexes to sync up operations in separate process and IPC functions. I would never have looked that futexes. Looks like reinventing an inferior wheel.
As they used to say on Laugh In, "very interesting... but stupid"
New Anything by Ulrich Drepper, makes my head hurt.
A lot of people don't like him. He is sort of like the OpenBSD guy in that respect.
New Mutexes of any sort are tricky.

Q:Is it proper to eat cheeseburgers with your fingers?
A:No, the fingers should be eaten separately.
New the coder doesnt have a clue
I guess I will be forced to chew thru the code sigh
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 55 years. meep
New It might be buried in a library he's using.
Thus why he has no idea.

Wade.

Q:Is it proper to eat cheeseburgers with your fingers?
A:No, the fingers should be eaten separately.
New potential partial solution
http://www.redhat.co...ealtime/features/
High-resolution timers: MRG Realtime includes support for timers with nanosecond accuracy. Optimized gettimeofday(): Many applications frequently call gettimeofday() operations for things like timestamping in log files. MRG Realtime includes an optimized gettimeofday() implementation that does not incur a context switch, resulting in significantly improved performance.
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 55 years. meep
     appeal to the java gods - (boxley) - (12)
         futex = fast userspace mutex. - (static)
         You can't get rid of the time checks unless you want to - (crazy) - (9)
             Re: You can't get rid of the time checks unless you want to - (hnick) - (6)
                 Futexes are tricky - (crazy) - (5)
                     Thanks, that helps. - (hnick) - (2)
                         Cursed as well - (crazy) - (1)
                             It appears that they deserve it. - (hnick)
                     Anything by Ulrich Drepper, makes my head hurt. - (folkert)
                     Mutexes of any sort are tricky. -NT - (static)
             the coder doesnt have a clue - (boxley) - (1)
                 It might be buried in a library he's using. - (static)
         potential partial solution - (boxley)

All artists are potentially a victim of their desire to be unique.
107 ms