Questions tagged [concurrency]
In computer science, concurrency is a property of systems in which multiple computations can be performed in overlapping time periods. The computations may be executing on multiple cores in the same chip, preemptively time-shared threads on the same processor, or executed on physically separated processors.
concurrency
23,315
questions
0
votes
0
answers
10
views
SubscriberContext state in case of concurrent HTTP Request in spring reactive
I have an HTTP API written in Spring Reactive which fetches user details from the datastore. I am adding the description for the API below.
@Configuration
class Routes {
@Bean
fun router() = ...
2
votes
1
answer
30
views
Manage concurrent users per single subscription
I am implementing a functionality in which user can take one subscription &** maximum 10 account can be created per single subscription but only 3 concurrent users are allowed**.
I am using ...
1
vote
1
answer
73
views
Multithreaded program not running as expected
I was trying to learn about semaphores, reading The Little Book of Semaphores by Allen B. Downey.
In that there is a puzzle:
Generalize the rendezvous solution. Every thread should run the
following ...
-1
votes
0
answers
93
views
Capture of 'self' with non-sendable type 'Type?' in a `@Sendable` closure
I have a warnings 'Capture of 'self' with non-sendable type 'Type?' in a @Sendable closure' for this code
func launchPairingAtCorrectStepAfter(timeout: TimeInterval) {
Timer.scheduledTimer(...
0
votes
1
answer
45
views
Conforming system type to a protocol with `@MainActor` isolation while disabling the concurrency check gives unexpected error
I have the following code that worked well:
protocol URLLauncher {
func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey: Any], completionHandler: ((Bool) -> Void)?)
}
extension ...
0
votes
0
answers
20
views
Multiple producer single consumer queue usecase
I am relatively new to Python and this is the usecase i am trying to solve as part of the learning.
There will be multiple threads calling a callback function. If the event is not set, the callbacks ...
0
votes
1
answer
62
views
Guarding tests against exit/death
I'm using googletest to test multi-threading code with std::thread. In broken code, it often happens that a std::thread is destroyed before the thread has joined, causing a program termination. ...
-1
votes
1
answer
49
views
Is it thread-safe by default to have nested CopyOnWriteArrayList?
Lets imagine I have the following code:
class ClassA {
final Integer i;
final String;
final CopyOnWriteArrayList<ClassB> l;
ClassA() { ...
}
}
class ClassB {
final ...
-1
votes
0
answers
19
views
Exception in HostObject::get for prop 'UIManager': java.util.ConcurrentModificationException - React Native
In our react native app (developed via expo with a custom dev client) we are encountering a problem. Some users have told us that very often the app crashes the first time it is launched on Android. ...
0
votes
1
answer
102
views
How to convert AdMob `GADFullScreenContentDelegate` to Swift 6 concurrency
This is a similar problem to How to convert `VNDocumentCameraViewControllerDelegate` to Swift 6 Concurrency but one warning is new, so this may require different solution.
I have the following code:
@...
0
votes
0
answers
40
views
Concurrency and Multi-threading
How can one implement a custom ReadWriteLock in Java that allows a thread to upgrade a read lock to a write lock without risking deadlock?
0
votes
1
answer
30
views
message-driven-channel-adapter - concurrent processing of messages
Issue
We have a legacy application with the following message-driven-channel-adapter configuration
<jms:message-driven-channel-adapter
id="processRequest"
destination=&...
0
votes
1
answer
75
views
How to convert `VNDocumentCameraViewControllerDelegate` to Swift 6 Concurrency
So I have this code:
fileprivate class DocumentScanDelegate: NSObject, VNDocumentCameraViewControllerDelegate {
static let shared = DocumentScanDelegate()
var compressionQuality: CGFloat = 1
...
-1
votes
0
answers
52
views
Non blocking Processbuilder output
When using ProcessBuilder, is there a true non blocking reactive way to consume the output? By true non blocking i mean not creating a thread that is blocked waiting to read, but push-based like ...
0
votes
0
answers
24
views
Adding Thread.sleep in spring boot web app adding delays to subsequent requests [duplicate]
@RestController
public class HomeController {
@GetMapping("/")
public String greet() throws InterruptedException {
System.out.println(Thread.currentThread().getName());
...