Questions tagged [single-threaded]

Single threaded as opposed to multithreading defines a code section, object or application that can run only using and allowing a single thread.

Single threaded as opposed to multithreading defines a code section, object or application that can run only using and allowing a single thread.

References

209 questions
1
vote
1 answer

What happens when multiple requests come to server

I am not sure about this topic. I'll try to explain that with examples. Let's suppose, I have a payment method on php webserver. Firstly the method checks are there unpaid orders. If yes, send request to bank servers to charge from the credit…
akcoban
  • 953
  • 7
  • 14
1
vote
1 answer

PHP: why the value is modified if there is no assign?

Basically there's not too much about it, since I put echo inside my code. It is a CLI script which should be single-threaded. echo "\$map: ".json_encode($map)."\n\$mapHarvests: ".json_encode($mapHarvests)."\n"; foreach($map as $key => $section) …
uIM7AI9S
  • 353
  • 4
  • 13
1
vote
1 answer

NodeJS Performance question - Single Threaded

Need some suggestions about how to handle operations in NodeJs. I have tried to search things but couldn’t find it anywhere, so I thought I will post it here to get the experts feedback. We have built an E commerce platform using NextJS and NodeJS.…
Oo-_-oO
  • 417
  • 7
  • 24
1
vote
2 answers

Is single threaded program executing on multiple threads? [C]

If I execute the following code which is single threaded: #include #include #include int main(int argc, char *argv[]) { char[] cmd1 = "cat /sys/class/thermal/thermal_zone0/temp > temp.txt"; char[] cmd2 = "cat…
Somdip Dey
  • 3,346
  • 6
  • 28
  • 60
1
vote
1 answer

Canvas is not updating until JavaScript has finished executing

Doing Infix to PostFix Stack Implementation using HTML5 canvas. The desired output is, element box in the canvas must have to output every character for 1 sec and then fade away. While the problem is element box in the canvas is updating after the…
Noor Muhammad
  • 73
  • 3
  • 10
1
vote
2 answers

How does single-threaded Node.js handles requests concurrently?

I am currently deeply learning Nodejs platform. As we know, Nodejs is single-threaded, and if it executes blocking operation (for example fs.readFileSync), a thread should wait to finish that operation. I decided to make an experiment: I created a…
longroad
  • 405
  • 4
  • 13
1
vote
0 answers

Run single-threaded in parallel in Azure

I have a simulation that can run only one at a time and takes 50-100 ms (CPU intensive). It is available behind an HTTP API. The requirement is to execute around 1000 HTTP requests per second (or around 100 instances in parallel). I tried Azure…
gajo357
  • 958
  • 12
  • 22
1
vote
2 answers

Does Electron's main thread block BrowserWindow?

I'm building an application that runs an Electron application. What I'm seeing is that when the main thread gets busy running its own operations, BrowserWindow's thread will get blocked (just like it does if the BrowserWindow itself is running…
user2167582
  • 5,986
  • 13
  • 64
  • 121
1
vote
1 answer

Difference between the `event loop phases` such as `I/O callback` and `poll`

I am unable to understand the difference between the two phases I/O callback and poll while reading through the mechanism of event loop of Node.js. My understanding is as follows. Please correct if it's wrong: For example, When we try to read the…
Prem
  • 5,685
  • 15
  • 52
  • 95
1
vote
1 answer

Wsgi single thread configuration on a multi-threaded apache server

WSGIDaemonProcess processes=5 threads=1 python-home=/path/to WSGIProcessGroup WSGIRestrictEmbedded On WSGILazyInitialization On WSGIApplicationGroup %{GLOBAL} My application uses Gdal which is not thread safe. The documentation…
raratiru
  • 8,748
  • 4
  • 73
  • 113
1
vote
0 answers

Is this a thread-safe way of removing elements from List

So I am making a game for Android and I have this singleton class called ParticleEmitter that has a function for adding particles to a CopyOnWriteArrayList. What gets added to the list is an abstract Particle, it can either be a Laser particle or a…
Jacob
  • 439
  • 6
  • 19
1
vote
1 answer

loop abruptly stops when converting rtf to html via thread

I am asking this question after 4 days of debugging so please bear with me. :) I have a list (commentlist) of 413 records logger.Debug("For each comment convert from rtf to Html: " + commentsList.Count().ToString()); int c = 1; foreach…
Samra
  • 1,815
  • 4
  • 35
  • 71
1
vote
0 answers

Asynchronous and single thread

"In the end threading is about how many blocks of code (i.e. threads) we run on your computer's microprocessor simultaneously. If you have multiple 'cores' (like most modern Intel processors have) you can run multiple 'threads' simultaneously (i.e.…
user6827412
1
vote
1 answer

How does single threading block DOM manipulation in JavaScript?

I hope my title is correct. I was at an interview today and was stumped by a question dealing with the event loop/ single threading. Here is the code: function longCB(){ for (var i = 0; i <= 9999; i++){ console.log(i); } …
user1842315
  • 307
  • 3
  • 13
1
vote
1 answer

What does "statically allocated" exactly mean in libc? One per library instance? One per program instance?

In (g)libc, for example in time and date functions like localtime, the manual says: The return value points to a statically allocated string which might be overwritten by subsequent calls to any of the date and time functions. As far as…
user7076126