- 0
[JAVA] Saving integers from a thread
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By AnalystDan · Posted
Did you read or just jump to the comments? -
By AnalystDan · Posted
No. They are not. -
By AnalystDan · Posted
Did Labour lose big? They had losses there is no doubt. However let's look at the reality. The conservatives have 168 councils I believe. Labour have 113 and Reform...38. That's a lot of growth for Reform granted. But that is not a wipeout, Reform don't have the majoring in fact at 76 I believe the Liberal Democrats have nearly twice the councils Reform do. So I am thinking there is a lot more noise than signal going on here. Now then let's talk about the law. It's an age restriction. We do it for cigarettes, **** and alcohol. This idea that some kids will find there way around it so it's not worth even trying is really really sad. Hell we can't stop every murder. Should we stop trying there too? That is the logical conclusion. -
By Lamp0 · Posted
A game not selling doesn't mean the people working on it did "bad work". It reviewed decently well. It was also on gamepass on release. -
By Copernic · Posted
PDF Shaper 15.6 by Razvan Serea PDF Shaper is a set of feature-rich PDF software that makes it simple to split, merge, watermark, sign, optimize, convert, encrypt and decrypt your PDF documents, also delete and move pages, extract text and images. The program is optimized for low CPU resource usage and operates in batch mode, allowing users to process multiple PDF files while doing other work on their computers. PDF Shaper is available in three editions - Free, Premium and Ultimate. Compare and pick edition which is suitable for you. Compatible with Windows 7, 8, 10, 11. Features: Convert PDFs to Word, text, or image files (and vice versa) Merge, split, and watermark documents with precision Insert, move, delete, rotate and crop pages/ranges Rename and organize PDF collections efficiently Encrypt with advanced AES password protection Apply multiple digital signatures for documents Extract text, images, or complete pages from any PDF Benefits: Easy-to-use, intuitive user interface Low CPU resource usage during any process, including conversion Free for personal use and for any non-commercial organization Supports Unicode characters Supports batch processing for any operation Small installation size PDF Shaper 15.6 changelog: Improved overall program performance. Improved image rendering in all tools. Improved XMP information extraction. Improved compatibility with ARM64 systems. Improved DOC to PDF conversion: Improved support for font files. Improved support for picture cropping. Improved support for list formatting. Improved support for text line spacing. Download: PDF Shaper 15.6 | 8.0 MB (Free for personal use only) Link: PDF Shaper Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
-
-
Recent Achievements
-
Console General earned a badge
One Year In
-
Twozo Technologies earned a badge
One Year In
-
Twozo Technologies earned a badge
One Month Later
-
Twozo Technologies earned a badge
Week One Done
-
branfont went up a rank
Veteran
-
-
Popular Contributors
-
Tell a friend
Question
+dave164 Subscriber¹
Hey,
I'm currently doing my assignment, which is a client, server network application. A concurrent server.
Its a concurrent server, and works perfectly for general communication. However i have to store how many times the file has been 'downloaded'.
The server works by creating a thread upon a successful connection. The server then has to print out how many times a file has been downloaded after its downloaded.
The thread when a file is downloaded calls a method in the server to increment the download count. However because its seperate threads when multiple clients connect it doesnt increment the updated number that another client might have set.
Output from my IDE to show what i mean:
Waiting for connection request...
Creating a new thread
Number of threads running: 1
Waiting for connection request...
File 1 has been downloaded 1 times.
Creating a new thread
Number of threads running: 2
Waiting for connection request...
File 1 has been downloaded 1 times.
Obviously File 1 should have been downloaded 2 times.
Any way to fix this?
Thanks,
David
Link to comment
https://www.neowin.net/forum/topic/706174-java-saving-integers-from-a-thread/Share on other sites
13 answers to this question
Recommended Posts