All Questions
Tagged with concurrency c#
1,712
questions
0
votes
0
answers
25
views
Problem with concurrency while updating data in DB using Quartz .NET and EF Core
I want to introduce horizontal scaling instead of vertical in my app.
Now we are using Quartz .NET for background tasks, but in non-clustered mode, just 1 instance.
So I found ability to do horizontal ...
1
vote
0
answers
48
views
How to handle a DB concurrency conflict when using a SumAsync() call?
I have a site that registers students to classes and uses a "Token" system as payments to register. Ex. 5 tokens to register.
When a payment is made to register for a class, I create 2 rows (...
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 ...
0
votes
2
answers
79
views
Testing concurrency of a collection with XUnit provides different results
I have a concurrent class called ClientManager that uses a hashset and a ReadWriterLock to register my "clients" through their Guid:
internal class ClientManager : IClientManager
{
...
0
votes
2
answers
134
views
Options to achieve parallel execution in C#
I have a use case where I need to process n number of operations, which involves other I/O operations.
Method 1: Uses ConcurrentBag<T>.
But worried that the I/O operations in the ...
0
votes
0
answers
64
views
Run 3 operation in parallel with 2 operations dependent on result of 1st operation C#
I have below method where, there is a call to a database in AppendExpandOption2DataAsync & AppendExpandOption1DataAsync if the ODataQuery options is passed and valid. However, the data that OData ...
0
votes
1
answer
53
views
How would I create a concurrency token check on multiple columns in my DB table in EF Core?
I have to charge my users a monthly fee and want to make sure I don't charge them twice.
I created a table called PlatformFee that looks like this to check to see if I've charged them. If there's any ...
0
votes
1
answer
53
views
Optimistic Concurrency Exception when Updating Entity with List<saleComments> Relationship in Entity Framework Core
I am trying to update a saleOrder entity in the database using Entity Framework Core. The entity has a property List<saleComments> Comments.
I have an issue when attempting to save the changes, ...
0
votes
0
answers
54
views
Lock the external API call for same values
Scenario:
I have a microservice that provides IP address information for other part of the system to use. This microservice uses an external API to get this info and each response will be saved on ...
1
vote
1
answer
55
views
Efficiently reading two different System.Threading.Channels from the same thread
Assume the following situation:
I have two different event streams
Stream 1 is a pull-based stream of very fast moving events (think financial instrument prices)
Stream 2 is much much slower moving (...
1
vote
1
answer
56
views
Repeatedly calling an API while concurrently processing that data in C#
Looking to figure out where exactly I'm going wrong.
I have a program that queries an API, the API returns data in chunks and will return a response header with a URL to the next chunk of data, if ...
0
votes
1
answer
122
views
How to handle concurrency issues with SQL Server?
I am having issues in my .NET 6 project using SQL Server and Entity Framework. I have my application deployed on Kubernetes, so there are 3 pods. I have multiple users attempting to fetch the next ...
1
vote
0
answers
51
views
C# Web API performance issue when there are multiple concurrent request which internally call AmazonPollyClient APIs
I am working on a product in which customer can come and configure the Amazon Polly TTS config. After that we have exposed one API /generateTTS which accepts 2 input parameters, text and config Id. ...
4
votes
2
answers
62
views
List<T>.AddRange throws ArgumentException when passing a ConcurrentDictionary as argument
Today I had a suspicion that the List<T>.AddRange method might not be safe to use with a concurrent collection as argument, so I made an experiment to find out:
ConcurrentDictionary<int, int&...
1
vote
2
answers
127
views
WPF application running parallel operations
I am developing a small software application. the overall logic of how it will work is this.
A UDP string is being broadcasted on the local network
The application will capture that string in the ...