Jan 19, 2013 at 3:35am UTC
I have small project have two thread.
Thread one put message to queue (lock – put – unlock)
Thread two get message from queue (lock – get – unlock)
This project run in Linux (build with GCC in Netbean) run faster than run in HP UX (buil with aCC in Netbean) six times.
Show Can you explain it for me, or have you a tip code in HP UX run faster as Linux.
Jan 21, 2013 at 3:56am UTC
In Linux I have run on:
Linux 2.6.32-300.3.1.el6uek.x86_64 #1 SMP Fri Dec 9 18:57:35 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
In Hp UX i hav run on:
HP-UX B.11.31 U ia64 3494992138 unlimited-user license
Jan 21, 2013 at 8:07am UTC
That's software. Again, what hardware? Are they real boxes or virtual boxes ...
Jan 22, 2013 at 2:01am UTC
This could come down to a million different things.
3. Processor (ia64 vs x64)
4. How busy the system was at the time
5. Operating System
Jan 22, 2013 at 8:44pm UTC
6. default/and compiler optimizations
Jan 29, 2013 at 1:53am UTC
@rapidcoder care to explain why that sounds inefficient? That gives an indication that he is locking only the minimal amount of code required to manipulate the container.
Jan 29, 2013 at 12:19pm UTC
Because he is locking the container. By definition locking means "slow" and "doesn't scale". If he want it to be fast, it must not use locking at all.
And don't judge performance by "minimal amount of code", please... Any amount of locking hurts performance more than switching to Python...
Last edited on
Jan 29, 2013 at 12:27pm UTC
Feb 7, 2013 at 9:09pm UTC
@rapidcoder of course he is locking access to the container, it's multi-threaded. Without locking he is subject to race conditions or unexpected behavior. Unless he is using only atomic operations (highly unlikely)