A piece of code is thread-safe if it only manipulates data structures in a way that allows consistent execution of this code by multiple threads. A code may be thread safe, conditionally safe (mutual exclusion required) or unsafe (can only be safely used by one thread).

-1
votes
0answers
8 views

Thread Safe variables in Spring

I have a question like which variables should be thread-safe in Spring framework and Angular 2 in order to support a multi-user web application?May I have your comments in this regard?Thank you.
0
votes
1answer
30 views

Are C# Static Extensions Thread Safe?

I'm using a static extension to convert a string to Sha256 as shown below:public static string ToSha256(this string value){var message=Encoding.ASCII.GetBytes(value);...
0
votes
0answers
10 views

Square .net API mutex for apiInstance.Charge [on hold]

How is the apiInstance.Charge called to protect from other calls at the same time.I am using session variables to pass the information to another .aspx page. If others call the charge at the same ...
0
votes
1answer
30 views

Null Pointer Exception with multiple callables

I am getting Null Pointer Exception for the below code.private class ProcessingThread implements Callable<List<Object>> {@Autowiredprivate DataRetrievalService ...
-1
votes
0answers
31 views

Writing ADC o/p to a buffer and reading from it [on hold]

I need to write a simple C program to read and write() data from an ADC output and store in a buffer and read() from it. Considering the ADC generates 32 bits of data at a time. Maybe I can use an ...
0
votes
2answers
49 views

Efficient way to write to file in rest service

i have a java rest service that receives around 1000 requests per second. Each request has a payload of 1KB. I need to write this payload to a single file. Since there will be 1000 requests per second ...
0
votes
0answers
23 views

Thread-safe Auto-Filling Reference - synchronized vs Atomic Reference with Soft/Weak Reference

I'm working on creating an auto-updating reference in java. The use case There are immutable objects that should be lazy initialed, including static objects. These objects will have spikes of calls ...
1
vote
3answers
138 views

Is a 128 bit int written or loaded in two instructions in C/C++?

I know that there exists a int128_t type in C and C++.If I have two threads one that is reading from a memory location containing this 128 bit integer and another that is writting to it. Is there ...
-1
votes
1answer
14 views

serial number add not synchronized

I don't know after put everywhere I can imagine "synchronized",but it's still thread not safe,help,thanks a lot!Multithread contend to add a serial number 'a'.should the thread Demo's run method can ...
-2
votes
1answer
48 views

.NET Core 2.0 Is the below code thread safe

Here's my code and I have doubt on thread safe implementation. My questions are belowThe return value from GetHtmlPageAsync is object. Is it thread safe? I will use this object and add into the ...
0
votes
0answers
36 views

Drawing in a Task / Thread

Im facing some issues to draw a rectangle (System.Drawing) in a Panel. The thing is that I have to do this using a Task in order to keep the UI responsive.I suspect that this is a thread-safety ...
1
vote
1answer
27 views

TCPClient Threading

I'm developing a game server. Through TCPListener I accept clients.var Listener=new TcpListener(IPAddress.Any, CommonConfig.Settings.GamePort);Listener.Start();ListenerStarted=true;while (...
0
votes
1answer
37 views

Is the following code thread-safe in Python?

I have code similar to the following in a Python module:_x=Nonedef set_x():global _x_x=# some value (will always be the same)def worker():if _x is None:set_x()Can threads created ...
2
votes
2answers
44 views

Thread Interruptded Exception, release semaphore resources

I have three threads and they need some resources to run (A,B,C) that I have implemented using Semaphores.public void run(){while(!Thread.currentThread().isInterrupted){try{A.acquire(2);...
1
vote
2answers
48 views

fork/join, synchronization necessary on input array?

I have a large array of objects and want to collect all objects with certain field value and because it is such a large array, i plan on using fork/join in java.the large array is forked not by ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,