operating-system

What is process and thread?

Yes, I have read many materials related to operating system. And I am still reading. But it seems all of them are describing the process and thread in a "abstract" way, which makes a lot of high level elabration on their behavior and logic orgnization. I am wondering what are they physically? In my opinion, they are just some in-memory "...

Strange behavior of Multiple Processes (C#).

I write two windows console application as below class ProgramA { static void Main(string[] args) { FileStream fs = File.Open(@"E:\console.txt", FileMode.OpenOrCreate); StreamWriter sw = new StreamWriter(fs); TextWriter old = Console.Out; Console.SetOut(sw); Console.WriteLine("Process A S...

how to mininize use of mutex in my C code ?

In one of my c code file, one of the global variable which needs to be update by almost every procedure in that file, is being locked and unlocked with mutex everytime and at every place. In my knowledge using too much of synchronization with mutex's lock and unlock definitely slow down the performance. So, My query is that how can i g...

How to write to a program's StdOut Stream directly in C# ?

I know that there're stdout/in/err for a program and I want to redirect a program's output to a file instead of the console output. And I now figure it out with the code below: FileStream fs = File.Open(@"E:\console.txt", FileMode.OpenOrCreate); StreamWriter sw = new StreamWriter(fs); TextWriter old = Console.Out; Console.SetOut(sw); Co...

Allocate a console for a WinForm application

I use the following code to allocate a Console for a WinForm application. The Console window shows up successfully and the output is there. But when I close the Console window, my WinForm applicaion is closed at the same time. Why? I want to keep the WinForm window. private void btn_to_console_Click(object sender, EventArgs e) { if ...

llvm on x86 barebone?

Does anyone know of any project involving running LLVm without an OS, i.e. directly on x86 hardware? ...

What happens during the shutdown process of an OS?

I hope this is programming-related enough. What exactly happens during the shutdown process of an Operating-System, let's take Linux here as its open-source and there may be more knowledge around about this. (How) are the kernel threads terminated? Does the power-supply stop supplying power (captain obvious) when the computer is in a ...

Difference between processes running in kernel mode and running as root?

I am aware of the difference between a process running in user mode and one running in kernel mode (based on access restrictions, access to hardware etc.). But just out of curiosity, what is the difference between a process running in kernel mode and one running as root? ...

Question about heap & stack memory usage.

In windows operating system, the stack memory is a thread-specific storage, and the call stack is the logic flow of a series of methods. So each thread has it's own stack area. I want to know how heap memroy area is used? Is it thread-specific? Process-specific? Or in .NET, AppDomian-specific? Or shared between all the user applications ...

booting from a disk/cd/usb

How can I boot my small console from a disk/cd/usb, with the following configuration: The media that I want to use will be completely raw i.e no filesystem on it. When I insert the media in my system or assume that its already inserted, I want to make it boot my own small OS. The procedure that I want to use is that when my system st...

Measuring process statistics in Linux

I am building programming contest software. A user's program is received by our judging system and is evaluated by compiling it and running it via a fork() and exec(). The parent process waits for the child (submission's process) to exit, and then cleans it up. To give useful information about the program's run, I want to measure the CP...

what is the difference between while(1) infinite loop and a recursive function?

what happens in the operating system exactly? for a recursive function mayb a stack overflow and for while(1)? please correct me if im wrong? ...

Will while(true) in a process of real time priority hang OS?

Will an application with an infinite loop hang the operating system if the application process has real time priority? Should I expect the same behavior on Linux, Windows and Mac OS? ...

Can someone explain pipe buffer limitations?

Python documentation to Popen states: Warning Use communicate() rather than .stdin.write, .stdout.read or .stderr.read to avoid deadlocks due to any of the other OS pipe buffers filling up and blocking the child process. Now, I'm trying to figure out how this deadlock can occur and why. My mental model: subproccess produces someth...

error while compiling tossim in tiny OS.

when i try to compile TOSSIM in tiny OS v-2.0.2 , this is the error that it is giving me make micaz sim Makefile:2: /opt/tinyos-2.1.0/support/make/Makerules: No such file or directory make: * No rule to make target `/opt/tinyos-2.1.0/support/make/Makerules'. Stop. how to remove this error? ...

How does a operating system create a unique file handle?

While creating a file, you provide the name of a file to operating system and it creates file and returns you the handle. I am curious to know how it is created. Does the operating system do some kind of hashing on file name to create a unique file handle or does it increase count of created files and return it as a file handle? ...

What pros/cons come from using a server OS for your main .NET development machine?

I was considering using Windows Server as the OS for my main .NET development workstation. It includes the version of IIS to which I'm most often deploying, manages FIPS compliance differently, etc. I certainly don't use any of the multimedia or gaming advantages (if there are any?) of a workstation OS. What pros/cons come with using ...

Conflict between system call number and system call handler pointer

When I was reading Operating System Concepts (7e, Silberschatz, Galvin, Gagne), I encountered a study project about adding a system call to the linux kernel. The book says that The system call numbers for recent versions of the Linux kernel are listed in /usr/src/linux-2.x/include/asm-i386/unistd.h. (for instance, __NR_close, whic...

NACHOS(JAVA verrsion) tutorials [setup and simple sample]

I need to setup NACHOS java version in Linux and run some simple sample . How to setup and run simple sample ? [need some tutorials and some computer assignment with solution with NACHOS] ...

what are the difficulties of operating system multithreading?

I am reading a book that compares two ways of implementing threads, Middleware Threads and OS Threads. I don't know what the meaning of these sentences are exactly: "A difficulty of operating system multithreading, however, is performance overhead. Since it is the operating system that is involved in switching threads, this involves syst...