Java BufferedReader vs Separate Producer consumer thread
I have a very big file delimited by some sequence of characters ‘*L*I*N*E’. The file will be of the order of 250G. And each line comes around 600bytes to 1000 bytes. I will be performing the following operations on the file,
Good reasons for destroying mutexes with waiting threads
I’d like to see some valid examples of needing to let a thread enter a locked, non-re entrant mutex, then destroying the mutex (which supposedly terminates the thread).
How could one make a reasonably efficient, pointer-sized mutex?
I have my own ideas about how a pointer-sized mutex could be made: The integer is used as a set of flags, counter, index, and a spinlock that guards an entry in a table of pre-allocated kernel objects given to mutexes only when threads are contending, and released afterward (only need at most N table entries for N threads).
Conceptually what does it mean when it is said that each thread gets its own stack?
I have been reading Java Concurrency in Practice by Brian Goetz and inside the section Stack Confinement it is mentioned that each thread gets its own stack and so local variables are intrinsically confined to the executing thread; they exist on the executing threads stack, which is not accessible to other threads. What does he mean that each thread has its own execution stack ?
How can we handle multiple instances of a method through a single class instance
How can we handle multiple instances of a method through a single class instance(Single constructor call)?
Are there deprecated practices for multithread and multiprocessor programming that I should no longer use?
In the early days of FORTRAN and BASIC, essentially all programs were written with GOTO statements. The result was spaghetti code and the solution was structured programming.
Can I implement the readers and writers algorithm in OpenMP by replacing counting semaphores with another feature?
After reading about OpenMP and not finding functions to support semaphores, I did an internet search for OpenMP and the readers and writers problem, but found no suitable matches.
How can I multiprocess my program?
I wrote a program which scrape internet sites. It is pretty straigtforward because it process link one by one.
I have data that sends in “bursts” of 100 records with a significant delay. How do I structure my classes for multithreading?
My datasource sends information in 100 batches of 100 records with a delay of 1 to 3 seconds between batches.
Why should most logic be in the monitor objects and not in the thread objects when writing concurrent software in Java?
When I took the Realtime and Concurrent programming course our lecturer told us that when writing concurrent programs in Java and using monitors, most of the logic should be in the monitor and as little as possible in the threads that access it. I never really understood why and I really would like to.