W32k and locking - ideas

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Post Reply
Linuxhippy
Posts: 39
Joined: Fri Dec 03, 2004 2:24 pm

W32k and locking - ideas

Post by Linuxhippy » Wed Feb 16, 2005 9:18 am

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

blight
Developer
Posts: 35
Joined: Tue Nov 30, 2004 10:34 pm
Location: away

Post by blight » Wed Feb 16, 2005 3:21 pm

...
Last edited by blight on Wed Feb 23, 2005 1:50 pm, edited 1 time in total.

Linuxhippy
Posts: 39
Joined: Fri Dec 03, 2004 2:24 pm

Hmm...

Post by Linuxhippy » Wed Feb 16, 2005 8:55 pm

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

Linuxhippy
Posts: 39
Joined: Fri Dec 03, 2004 2:24 pm

Hmm..

Post by Linuxhippy » Sat Feb 19, 2005 5:52 pm

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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests