Kernal locking support in X?

Posted:
in macOS edited January 2014
Does OS X have kernal locking support? FreeBSD does. Any thoughts?

Comments

  • Reply 1 of 7
    hmurchisonhmurchison Posts: 12,423member
    Quote:

    Originally posted by dstranathan

    Does OS X have kernal locking support? FreeBSD does. Any thoughts?



    What does Kernel Locking do?
  • Reply 2 of 7
    costiquecostique Posts: 1,084member
    Quote:

    Originally posted by hmurchison

    What does Kernel Locking do?



    If I am not mistaken, kernel locking ensures that in multiprocessor configs only one processor at a time is in the kernel. This makes no sense in single-CPU systems and, I presume, is a workaround for the eternal problem of having 2 hands and 1 pocket (or is it 2 mouths and 1 spoon?).
  • Reply 3 of 7
    costiquecostique Posts: 1,084member
    Quote:

    Originally posted by dstranathan

    Does OS X have kernal locking support? FreeBSD does. Any thoughts?



    A quick search shows that Darwin has a whole lot of locks inherited from both FreeBSD and mach. Use the link above to learn more.
  • Reply 4 of 7
    dstranathandstranathan Posts: 1,717member
    Is there ANYWAY to configure Samba on OS X Server to dissallow a Mac and a PC to have the same word file open at the same time? I think kerel locking is a factor here:



    Hypothetical:



    If a Mac user has a Word file open (which resides on a AFP share) and a 2nd Mac user tried to open it over the LAN, the 2 user's apps seems to "talk" to each other properly: "Hey, I'm using this file, come back later, or make a copy."

    If 2 PCs are in the same scenario as above on a SMB share, Samba, Word XP and Windows seems to handle the problem OK. They notify each other and lock the file accordingly.



    BUT:



    If a Mac user has a Word file open, and a PC user tries to open the same file over the LAN (or visa versa), NOTHING is done by the apps (or file server) to stop them from both having the same file open at the same time!





    My network has both Macs and PCs who will be sharing mutual shares on my OS X Server via both AFP and SMB. What can I do?



    Is KERNEL oplocking the solution? Does OS X support this? What versions of Windows support this?
  • Reply 5 of 7
    dstranathandstranathan Posts: 1,717member
    Oui! Oui!



    MacBidouille reports that the next version of Mac OS X (10.3 aka Panther) will feature a new file system format akin to BeOS's file system.



    http://www.macbidouille.com/niouzcon...003-03-26#5095



    Looks like Panther (10.3) WILL have a new, more modern file system! Does more robust file locking seem more realistic in the future?





    http://www.osnews.com/story.php?news_id=421&page=13



    http://www.theregus.com/content/4/24485.html
  • Reply 6 of 7
    costiquecostique Posts: 1,084member
    I'm afraid, kernel locking has little to do with file sharing. In fact, an app may open a file, read the data and close the file (like Photoshop) so that you can even delete the opened file. On the other hand, an app may decide that a file can be opened only once at a time and just leave the file open after reading the data. Then the operating system doesn't give other apps access to that file because 'it is in use'.

    I am not sure about Word, but I think it is a feature, not a bug. IIRC, no operating system will allow access to a file already opened for writing because it may lead to unpredictable results. Though there is a workaround (as I said earlier) to close the file after reading, it's up to an application to do it or not.

    I don't know how to change Word's behaviour, I just have never seen the option in any app's prefs.
  • Reply 7 of 7
    pp Posts: 12member
    Kernel locking means that if CPU 0 is running in the kernel, then CPU 1 can't also do that. Since OS X runs on duals, the answer is yes



    What FreeBSD is doing is removing the Giant lock - one lock for the entire kernel - and replacing it with several smaller ones: One for the scheduler, one for the TCP/IP, one for VM, etc. The point is that CPU 0 can run in the scheduler and CPU 1 in TCP/IP - well, once they're done, at least. I believe Darwin already has this as well, but I'm not certain.
Sign In or Register to comment.