Hello!
I have been very fascenated about the work w3seek puts into w32k to speed it up by replacing the fine-grained locking by setting a few global locks.
Of course I am quite a much worse programmer than w3seek but my (underpowerd) head worries about scaliability facts.
I understand that traditional locking is quite expensive, but in java locking is >nearly< free, since many of the old java-libraries are fully synchronized (every method sets a lock) and the penality for doing this (despite scalibility) is not soo high.
Java-VMs archive this by using a technique called "thin-locks", which are very fast on uniprocessor-machines, and a bit slower on multiprocessor-machines.
If some locks often occur those thin-locks are replaced by "hard-lock".
I do not know how this works internally (I think on uniprocessors it relies on the fact that only one thread can be executed at once) - but its quite fast.
Any ideas, suggests or statements are welcome!
lg Clemens
W32k and locking - ideas
Moderator: Moderator Team
-
- Posts: 39
- Joined: Fri Dec 03, 2004 2:24 pm
Hmm...
Well, but whats so different between Java locking and C locking.
Java also uses native threads so you can't say it can handle thread-scheduling and locking itself, it also relies on the OS features.
If such techniques are possible in java why should they not be possible in C?
e.g. just tuning locks on uniprocessor machines.
lg Clemens
Java also uses native threads so you can't say it can handle thread-scheduling and locking itself, it also relies on the OS features.
If such techniques are possible in java why should they not be possible in C?
e.g. just tuning locks on uniprocessor machines.
lg Clemens
-
- Posts: 39
- Joined: Fri Dec 03, 2004 2:24 pm
Hmm..
Btw, Linux also has a counterpart names "Futex" which means "Fast User Space Mutex" which again means that no system call is nescessary to accquire or release a mutex.
Why cant this also be implemented in ROS?
Thanks in advance, lg Clemens
Why cant this also be implemented in ROS?
Thanks in advance, lg Clemens
Who is online
Users browsing this forum: Majestic-12 [Bot] and 69 guests