Multithreading is how work performed by a computer can be divided into multiple concurrent streams of execution (generally referred to as threads).
2
votes
1answer
39 views
C# program that uses events
I am trying to learn C#. Please tell me if the following code respects coding standards and naming conventions because I want to write beautiful code. The purpose of this program was to help me ...
2
votes
1answer
54 views
Multithreading pthread program
My multithreaded version of code works slowly than singlethreaded. Can you help me to understand why?
...
-1
votes
0answers
16 views
Shared memory, pthreads and pointers. Updated Data structure not being read correctly within thread [on hold]
Can anyone tell me why my shared memory data structure is not being read correctly by pthreads?
Initially, the structure being referenced, is created in shared memory space, so two different ...
0
votes
0answers
14 views
wrote a code for race in java won't work [migrated]
Can anyone do a review of my code? I am new to Java. I tried to run it. It gave an Illegal Monitor State Exception Error in Race and RaceMain class. Thanks a lot if you read it.
...
6
votes
0answers
51 views
Mutual Exclusion with Mutexes
After I wrote this question: Producer/Consumer programs, I realized that I had forgotten to write a version using mutexes. I have now written a Producer/Consumer problem solver using mutexes using ...
1
vote
1answer
44 views
Can I get around manually resuming a thread in this C++ thread class?
I have inherited a C++ Win32 thread class which roughly works like this.
I am looking for ways to improve the design; specifically I am looking for a way to get rid of the spurious ...
4
votes
2answers
61 views
Generic Object Pool in C#
I have a limit of 100 sessions (each session held in an object). Many threads will be requesting sessions, and it is very possible that all 100 sessions could be in use at any time.
I'm a Junior ...
13
votes
3answers
153 views
Producer/Consumer programs
I am studying mutual exclusion in college, and we just covered the producer/consumer problem. The class does not involve writing code, but I decided to implement a bounded buffer version of this ...
2
votes
2answers
54 views
Handling thread interruptions in a directory iterator
This code is code written on a whim to help $someindividual asking for such a thing on $somechatmedium; what is needed is a way, ...
6
votes
1answer
176 views
+50
Efficiently using ZeroMQ sockets in Java
I am working on multithreading project and I am using ZeroMQ socket to send the data as a byte array. Below is my example which works fine. I'm opting for code review to see whether it can be improved ...
1
vote
2answers
75 views
Proper way to wait end of a service and singleton design
My code works fine and I would like to know if I chose the best strategy to implement my code, or if It can written better (more fast, more clear, best use of design pattern, etc).
In my android ...
1
vote
0answers
19 views
Python Multiprocess Dictionary Selector [closed]
I am attempting to select devices via telnet based on a key I get from pinging the telnet device. Basically it selects to use only the devices with the given key. I am running into issues when a ...
0
votes
0answers
29 views
From multiprocess to multithreading [closed]
I recently joined a team responsible for the enhancement of an existing 5-year old program.
It was developed with multithreading in mind, but not correctly implemented.
The solution is composed of ...
4
votes
2answers
44 views
Threaded generalised transform
I'm writing an application which works with huge amounts of sequential data, and often found the need to use std::transform. I see two potential improvements to ...
2
votes
2answers
120 views
Producer/Consumer Program
I am a semi-new Java programmer that tends to be a perfectionist. What I'd like to know about my code:
How it compares to common practice.
Is it readable?
Are my comments appropriate?
Any ...
5
votes
1answer
55 views
General Batched Job Runner
This question is inspired by:
Generic Task Scheduler
where the problem is to run tasks on a scheduled basis, in parallel, and have individual timeouts for each job.
For example, consider this ...
2
votes
1answer
43 views
Precognitive waiting - waiting for something to finish, before it starts
I have implemented a class that has a method to wait until "something else" has happened. When this has happened, the current thread stops waiting and returns from the method. This is my current code:
...
3
votes
1answer
31 views
Syncing e-mails for multiple accounts
I wrote an email syncing program in my ASP.NET MVC website that syncs e-mails from multiple e-mail accounts to my database.
Each e-mail account has to be independent from other accounts and they have ...
1
vote
0answers
51 views
Generic Java Task Scheduler (Followup) [closed]
As a followup to my previous question, and after receiving a great answer, here is the updated Scheduler class.
I would also like to state some goals & ...
7
votes
1answer
89 views
Generic Java Task Scheduler
I wrote this generic task scheduler for executing tasks in fixed-delay intervals, can you find anything wrong with it, or issues that may arise from using it for sending something like queued mails in ...
4
votes
2answers
74 views
Managing FutureTask and ExecutorService
I have many unrelated tasks to execute and I have to get the result of the task so I use the FutureTask.
I submit all the task to the thread pool and use a map to ...
4
votes
2answers
153 views
Concurrent activity on ArrayList
I have an immutable Point class and a CollectionPoint class which manages instances of my ...
1
vote
2answers
79 views
Logger facade code for configuring multiple loggers are runtime
Following is the code for a logger facade that I have created, which can be used to log via any of the standard and configurable loggers like log4net, BitFactory, currently I have just integrated ...
5
votes
0answers
54 views
Multithreading in a 2D Mining Game
I have implemented some basic multithreading in my 2D mining game that I asked about in a previous question. The first part is working out great (creating the initial object instances in the ...
1
vote
2answers
81 views
Thread, handler and activity structure for a bouncing ball animation
This is a custom MyActivity class with two custom views (bar and a ball):
...
6
votes
4answers
110 views
Efficient prime factorization for large numbers
I've been working on a little problem where I need to compute 18-digit numbers into their respective prime factorization. Everything compiles and it runs just fine, considering that it actually works, ...
2
votes
1answer
65 views
Lockless, blocking, non synchronized multiple producers and consumers ring buffer
My program is structured like this: there are M producer threads, each of which computes a section of an object O with index ...
1
vote
1answer
66 views
Monitoring progress in Parallel.ForEach every minute
I'm using Parallel.ForEach to download 500K URLs and I want to monitor the number of URLs that have been successfully downloaded each minute.
...
6
votes
2answers
81 views
1
vote
2answers
99 views
Queue with task parallel library
I am new to programming using the .Net TPL Framework and multi-threading in general. I have googled up some tutorials and articles and put together the solution below.
It is a simple multithreaded ...
1
vote
1answer
58 views
Crawl multiple pages at once
This an update to my last question.
I want to process multiple pages at once pulling URLs from tier_list in the crawl_web ...
4
votes
1answer
42 views
Threading and queue experiment
I'm just beginning to get the idea of queue and threading.
I would welcome input on this exercise script:
...
1
vote
1answer
37 views
Multithreading synchronization between reading and writing in a channel
I was hoping to get some feedback on what the recommended design pattern are for this subject.
...
1
vote
1answer
53 views
Reading a property on a main thread that is set on a background thread
I am currently handling some setup of an object on a background thread (I am using a concurrent queue within the following initWithDocumentFileURL method):
...
1
vote
2answers
78 views
Multi Threaded Report Generation
I have a requirement where i have to generate some report basically read from db and write data to Excel.
I want your help in reviewing following things in my code.
Data Base Connection
Multi ...
2
votes
1answer
50 views
Show a ProgressDialog and send an SMS in the background
I have written a procedure that
shows a ProgressDialog
sends an SMS
updates the View from another thread
hides the ...
10
votes
4answers
418 views
Multithreaded HiLo game
For my CS class I have to write a HiLo game using multithreading. I am brand new to multithreading and not sure how to best implement it. The program below works, but I am wondering if there is a ...
3
votes
1answer
57 views
Python Threading
I have the code below that I am using to thread certain tasks. Basically, you pass in a function reference, a list of data and the number of threads. It will run the function for each item in the list ...
0
votes
1answer
24 views
ConnectionPool using LinkedBlockingDeque
Below is the code snippet that I developed for ConnectionPool. Kindly let me know if there are any problems or shortcomings with the below code. I've deployed it to our test environment and was able ...
7
votes
2answers
144 views
SQL service broker and threading
Basically my code waits for database table a to have an XML string inserted into it. The SQL query parses the XML string and stores it into separate columns (this ...
4
votes
1answer
42 views
Optimization of Barnes-Hut Multithread Insertion algorithm
I'm currently working on optimizing a Barnes-Hut implementation (connected to a previous post I did) and I need help to optimize it further.
After some testing, the main problem appears to be in the ...
1
vote
1answer
35 views
Decoding an element list
I have a function which I am calling an infinite number of times (or until a condition is met). The problem with this recursive function is that on a higher level, it is called by a worker thread ...
3
votes
2answers
176 views
Multithreading decouple update-logic and render-logic
I want to improve my multithreading competence and tried to build a compact doublebuffered way to separate two threads where one is only displaying the state and the other one updates the state. So I ...
2
votes
1answer
59 views
Taskqueue multithreading
I have a synchronized list that I use as a taskqueue. In this queue I have some long values that need to be proceed and create heavy I/O and delay. I thought of using threads to get things done ...
0
votes
1answer
68 views
Handle concurrent HTTP requests with a generic .ashx
I have created a .ashx file that is able to handle concurrent http requests.
Works great, but now I'd like to create a base class that does the common work in order to not repeat myself each time I ...
10
votes
4answers
292 views
Ugly optimized caching of SimpleDateFormat
Concerning the optimization of this simple function
String formatDate(String format, Locale locale, Date date) {...}
formatting a ...
2
votes
2answers
318 views
How to efficiently use RestTemplate with HttpComponentsClientHttpRequestFactory in multithreaded environment?
I am working on a project in which I need to make a HTTP URL call to my server which is running Restful Service which returns back the response as a JSON String. I ...
5
votes
1answer
149 views
General multithreaded file processing
I'm trying to write a general multithreaded file processing facility. The idea is that some input file consists of a number of discrete records, each record needs to be processed in the same manner, ...
4
votes
1answer
171 views
Creating Thread safe list using Lock object
Will this code qualify for a truly thread safe list? It is using the Lock object.
...
1
vote
1answer
139 views
Creating Thread Safe or Concurrent List [closed]
Can a thread safe or concurrent list be created using the code mentioned underneath, where I wrap all the calls to the base class in a ReaderWriter lock. I can similarly implement all the public ...