The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
43 views

synchronization (test-and-set)

I have benn wondering about the following possibility: if I have multiple hardware threads on the same core, and then someone decides to use shared register to allow fast synchronization among threads ...
3
votes
2answers
119 views

Why can't fibers utilize multiple processors?

It seems that the distinction between fibers and threads is that fibers are cooperatively scheduled, whereas threads are preemptively scheduled. The point of the scheduler seems like a way to make an ...
3
votes
0answers
23 views

Mutex implementation on top of a preemptive scheduler that does not guarantee liveness

I'm implementing some synchronization primitives in the standard library of an operating system. Specifically, I want to implement mutexes and condition variables. This is on top of a microkernel with ...
4
votes
1answer
155 views

Mutex implementation on top of a minimalistic preemptive scheduler

In this question, I'm implementing some synchronization primitives in the standard library of an operating system. Specifically, I want to implement mutexes and condition variables. This is on top of ...
0
votes
2answers
111 views

How to implement mutex on single processor (single core) system other than using spinlock

How does one implement mutex on a single processor system without using spinlock mechanism. Mutex is to be implemented in user space (for any user level library like pthread lib for example).
0
votes
0answers
18 views

Context switching in M:N threading models?

I wanted to know how M:N kernel user thread model handles context switching, between multiple khread and pthread. How does the PCB/TCB for process and threads look like, how is state of registers ...
4
votes
1answer
105 views

What happens when thread is created

When working on Linux what happens when a thread is created? It is a separate execution flow. Does each thread have their own code section? Personally I don't think threads would be able to share code ...
0
votes
0answers
64 views

Switching between user-level and kernel-level threads

After reading difference between user-level threads and kernel-level threads ,now I am in doubt of context switching.Context switching is managed by OS when switching between processes/threads but ...
1
vote
1answer
46 views

Passing parameters to threads

in Programming language course my professor take an example. Suppose the following code: ...
2
votes
1answer
114 views

Is it possible to solve the critical section problem with an atomic subtract operation?

In my Operating Systems class, our professor asked us to solve the critical section problem with the following atomic operation: ...
7
votes
1answer
45 views

Why using Hyper-threading can lead to performance degradation

I have read it at various places like this, that Hyper-threading leads to performance degradation. I am unable to get why or how hyper-threading leads to degradation. Why it is so that even when ...
3
votes
1answer
182 views

How do locks work?

Suppose I have an application with two threads, which both use the same resource. Normally, a synchronized block keeps these threads from messing with the resource in a way the user doesn't expect. I ...
0
votes
1answer
51 views

Simulating a sequence of events concurrently subject to a happened-before partial order

I am building a strategy game where multiple units(5 - 20) is fighting each other in the same time. I have a logic part that calculate those actions for each turn, and than pass it to the game ...
6
votes
1answer
163 views

Inconsistent state of a lock

I'm reading The Art of Multiprocessor programming and trying to understand their concept of inconsistent locks. Specifically, on page 37, the definition 2.8.1 of an inconsistent lock is not clear to ...
1
vote
2answers
122 views

Time cost of thread creation

While creating an algorithm, the following question came up: In uniform cost, what is the time cost of a process that creates a thread? Is there a difference between creating a thread in a ...
0
votes
1answer
19 views

Timing threads in an algorithm

This question relates to timing threads to go at a very precise rate. Consider the following scenario; A program creates a series of threads that continually add a random set of elements to their ...
0
votes
1answer
19 views

Local and Global storage with multithreading pools + locking threads

I am having difficulty answering the following questions relating to the use of threading. Question 1 is of relating to the possibility of a local storage per thread and a global storage accessible ...
0
votes
1answer
88 views

Is the way an OS schedule threads related to parallel computing?

From Wikipedia: Operating systems schedule threads in one of two ways: Preemptive multitasking is generally considered the superior approach, as it allows the operating system to determine ...
5
votes
1answer
103 views

Question about threads and locks

I am currently reading Fuss, Futexes and Furwocks: Fast Userland Locking in Linux and came across this quote: In a fair locking scheme the lock is granted in the order it was requested. This can ...
0
votes
1answer
36 views

executing threads with no synchronization

suppose Threads 1 and 2 are executing concurrently with shared integer variables A, B, and C. Thread 1 executes:A=4, B=5, C=B-A; Thread 2 executes: A=3, B=6, C=A+B; I'm trying to find what can the ...
1
vote
1answer
38 views

If a thread containing main terminates, can another thread do anything?

I'm studying threads in C and I have this theoretical question in mind that is driving me crazy. Assume the following code: ...
1
vote
2answers
52 views

Does splitting a process across 4 terminal windows decrease the time it takes?

Basically, I using an algorithm called 'miranda' to look at miRNA targets and it only runs on a single thread. It compares everything in one file against everything in another file, produces a file as ...
3
votes
1answer
84 views

How to express Rob Pike's classic Go Code presentation in Hoare's CSP Algebra?

At 15:30 in this talk (p13 of this presentation here) Rich Hickey mentions the formalisms available for reasoning about Communicating Sequential Processes. He then goes on to mention that these ...
-1
votes
1answer
107 views

processes response time confusion

An OS contains 10 identical processes that were initiated at the same time.Each process contains 15 identical requests. Each request consume 20 msec of CPU time.A request is followed by an I/O ...
3
votes
3answers
74 views

Reasons for decreasing the number of threads in a parallel implementation

What are the reasons for decreasing the number of threads in a parallel implementation ? Assume that we have two implementations, the first one with 4 threads, and a second one with 8 threads, and ...
5
votes
3answers
248 views

Is it possible to prove thread safety?

Given a program consisting of variables and instructions which modify these variables, and a synchronization primitive (a monitor, mutex, java's synchronized or C#'s lock), is it possible to prove ...
1
vote
1answer
115 views

Process state in multi threaded process

What would be the process state in a multi threaded process, in which threads are in different states (running, waiting, blocked etc)
5
votes
1answer
734 views

How are threads implemented in different OSs?

I was reading Linux Kernel Development by Robert Love, where I came across this Linux takes an interesting approach to thread support: It does not differentiate between threads and normal ...