operating-system

How to get the User ~/Library path in Java for the Mac OS

On the Mac OS, from what I understand you're suppose to store information in "/Library/Application Support/Your App Name" if the files are to be read by everyone. However when it comes to writing, this is an admin only folder. Therefore, if you want to write data, you need to store it to "~/Library/Application Support/Your App Name". No...

What are trade offs for "busy wait" vs "sleep"?

This is in extension to my previous question http://stackoverflow.com/questions/1107391/how-does-blocking-mode-in-unix-linux-sockets-works What i gather from Internet now, all the process invoking blocking calls, are put to sleep until the scheduler finds the reasons to unblock it. The reasons can vary from buffer empty to buffer full ...

How does a "kill" work? And especically how does a "kill" work on blocked proces?

Who in the kernel is responsible for killing a process. What if a "kill" comes, and the process is in the blocked state. Does the kill waits until the process comes to running state to clean himself. If someone can answer more in terms of kernel, like when a SIGINT from the kill command is generated, what all is invoked by the kernel...

Why does a 32-bit OS support 4 GB of RAM?

Just reading some notes in a purdue lecture about OSs, and it says: A program sees memory as an array of bytes that goes from address 0 to 2^32-1 (0 to 4GB-1) Why 4 GB? ...

What is the difference between a stack overflow and buffer overflow ?

What is different between stack overflow and buffer overflow in Programming ? ...

Flow control Sliding window implementation. Which is better static-queue(array) vs dynamic linked-list?

I am implementing a sliding window for a trivial protocol. I was implementing the window using a static circular queue (array), as i though it is efficient. But one of my friends said, he has seen the implementation of sliding window in tcp, it uses a linked list. I dont think he has seen, as he doesnot know where is network code located...

Question about paths in Python

Hello, let's say i have directory paths looking like this: this/is/the/basedir/path/a/include this/is/the/basedir/path/b/include this/is/the/basedir/path/a this/is/the/basedir/path/b In Python, how can i split these paths up so they will look like this instead: a/include b/include a b If i run os.path.split(path)[1] it will displa...

Is there any chance Chrome OS will support .NET framework?

Is there any chance Chrome OS will support .NET framework? Or will we need to learn Java... ...

using unix domain socket and sharing fd's

Hello All, Not been able to figure out why recvmsg() blocks when i try this test app on ubuntu. http://web.mit.edu/kolya/misc/break-chroot.c thanks ...

Detecting and controlling unauthorized shared memory reads

Hi all, I was wondering - are there any known techniques to control access to a shared memory object from anywhere but an authorized program? For instance, lets say I create a shared memory segment for use in a program P, to be accessed by Q, and I make it Read-Write. I can access it using Q because I've given it (Q) the required permi...

What virtual machine can I use to virtualize Mac OS in Windows?

I want to run Mac OS in my Windows operative system, is there any virtual machine that does that? Tnks. ...

Python: Get Mount Point on Windows or Linux

I need a function to determine if a directory is a mount point for a drive. I found this code already which works well for linux: def getmount(path): path = os.path.abspath(path) while path != os.path.sep: if os.path.ismount(path): return path path = os.path.abspath(os.path.join(path, os.pardir)) return path But I'...

Buffer Overflow (vs) Buffer OverRun (vs) Stack Overflow

Possible Duplicate: What is the difference between a stack overflow and buffer overflow ? What is the difference between Buffer Overflow and Buffer Overrun? What is the difference between Buffer Overrun and Stack Overflow? Please include code examples. I have looked at the terms in Wikipedia, but I am unable to match with pr...

Why must UI elements always be created/updated from the UI thread?

The title says it all: Why must UI elements always be created/updated from the UI thread? In (almost?) all programming languages UI elements may be safely accessed/modified only from the UI thread. I understand that it's a standard concurrent access and synchronization problem, but is it really necessary? Is this behaviour imposed by th...

Terminology about thread

If a function in a thread is going to return, how can we describe this behavior. The thread returns. The thread is dying. What's the meaning of "thread is dead"? ...

Mutual-exclusion using TestAndSet() instruction

The book Operating System Principles by Silberschatz, Galvin and Gagne contains the following definition for the TestAndSet() instruction in the chapter on synchronization: boolean TestAndSet(boolean *target) { boolean rv = *target; *target = TRUE; return rv; } An implementation of mutual-exclusion using the above instruct...

Is there an operating system API wrapper library for c++?

Hi SO-followers, does sombebody know a C++ library for accessing different operating system APIs? I'm thinking about a wrapper to access OS specific functions. Something like: osAPI.MessageBox(); // calls MessageBox() in Win32, equivalent in Mac OS Linux etc... Since I think it's hard to realize this for different OSes for now it wou...

What is the best OS + framework / library for programming advanced mobile applications?

What is the best OS, framework / library and Bluetooth stack for programming advanced mobile applications utilizing things like Bluetooth OBEX (OOP, DID, HID), IrDA (for remote-controlling consumer electronics), VGA-cam (as a movement sensor) as well as access to local databases or CSV-fles? What are the trade-offs between the OS (PalmO...

Does JIT performance suffer due to writeable pages?

In the book Linkers and Loaders, it's mentioned that one of the reasons for executables to have a separate code section is that the code section can be kept in read only pages, which results in a performance increase. Is this still true for a modern OS? Seeing as Just in Time compilers are generating code on the fly, I assume they need w...

what is a reentrant kernel

What is a reentrant kernel? ...