Questions tagged [shared-state]
28 questions
1
vote
1 answer
Is Calling the `Wait()` method of `sync.Cond` Concurrently, Safe?
Is calling the Wait() method of sync.Cond safe when according to the documentation, it performs an Unlock() first?
Assume we are checking for a condition to be met:
func sample() {
cond = &sync.Cond{L: &sync.Mutex{}} // accessible by other parts…

Kaveh Shahbazian
- 13,088
- 13
- 80
- 139
1
vote
1 answer
What is Shared State in an ASP.NET MVC Application?
In a recent Stackoverflow podcast (#59), Jeff Atwood mentions that Stackoverflow has some "shared state." I understand the general idea of shared state, but what exactly is shared state in the context of an ASP.NET MVC application, like…

Andrew Garrison
- 6,977
- 11
- 50
- 77
1
vote
3 answers
Haskell concurrency using simple IORef?
I've been asking a few questions about concurrency in Haskell, particular TVar, and I've had concerns about livelock with TVar.
Instead, I've proposed this solution.
(1) Wrap all shared data in the program in one data structure, and wrap that in an…

Clinton
- 22,361
- 15
- 67
- 163
0
votes
1 answer
How do I implement shared state in an ASP.NET MVC 3 application?
I'm writing a basic RESTful service, and decided I'd use ASP.NET MVC 3 for the task. My application is going to be responsible for maintaining a persistent connection to a server per user (for now). I had assumed that Application_Start is the place…

Josh Smeaton
- 47,939
- 24
- 129
- 164
0
votes
1 answer
How to reuse fetched data in Vue 3 (Nuxt 3)?
I am updating a Nuxt2 project to Nuxt3. Before I used Vuex to share some data across my app. I loaded the navigation structure from an endpoint and could use that information across my components.
Now in Nuxt 3 I thought I could write a composable…

Merc
- 4,241
- 8
- 52
- 81
0
votes
1 answer
Shared mutable state with websockets in Rust
I am using actix-web to run a webserver and want to be able to mutate state through websocket messages.
My current way of using websockets is through implementing the handle method from actix::StreamHandler. However this limits my ability of passing…

LBlend
- 31
- 1
- 4
0
votes
2 answers
How share variables to the threads in Java?
My program will use threads, but some variables like a collection of links/pages, information about queries (if is updating or none) and some others informations(boolean fields, int fields, etc.) must be shared by the threads.
In this case, all the…

Renato Dinhani
- 35,057
- 55
- 139
- 199
0
votes
1 answer
Python multiprocessing job submission based on aggregate criteria for all jobs running
Python multiprocessing job submission based aggregate criteria for all jobs running
I have a job that needs to do some work on the Teradata Database and takes number of db sessions as an argument. The database has max limit of 60 on the number of…

Partha Sarkar
- 357
- 1
- 2
- 9
0
votes
1 answer
Android + CustomView: Share the state of custom views while waiting for a network response
I have the next escenario:
A activity has 2 fragments.
Each fragment has a custom view (the same but different instances).
One fragment algo invoke a DialogFragment to emulate the view increase in size to full screen, so it's has another of the…

fitu
- 115
- 3
- 13
0
votes
1 answer
Is it safe to call pthread_create while holding a mutex?
Suppose I have code that is holding a mutex while accessing some shared state. At some point, I determine I need to create a new thread, and thus call pthread_create, while still holding the mutex. Is this considered safe?
Suppose my shared state is…

Tob Ernack
- 241
- 2
- 12
0
votes
1 answer
Share data between Java EE servers
What products/projects could help me with the following scenario?
More than one server (same location)
Some state should be shared between server (for instance information if a scheduled task is running and on what server).
The obvious answer…

Roland
- 5,328
- 10
- 37
- 55
0
votes
1 answer
Passing a variable from one controller method to another
I'm using the CodeIgniter framework. I load a main view, which contains several tabs, which load other views in a
via AJAX. My controller class looks like this:
class MainController extends MY_Controller
function main($id=0)
{
…

bausa
- 111
- 2
- 9
-3
votes
2 answers
How to share state between programs?
I have 2 programs that must communicate with each other. They should share state (variables, files - i don't know how to achieve this).
One program should read it and react on changes - the other should write to this global state.
Using files for…

ein mensch
- 311
- 2
- 9