Questions tagged [writers]
8 questions
9
votes
1 answer
Is there a simple and safe way to convert a PrintWriter into a PrintStream?
Is there a clean and simple way to convert an instance of java.io.PrintWriter into a java.io.PrintStream?

Armand
- 23,463
- 20
- 90
- 119
3
votes
2 answers
1 writer, M readers to consume the same item
Assume this problem:
2 programs, A and B, 1 process of A, M processes of M, 1 shared variable named var
A
main(){
int i, a[50];
for(i=0;i<50;i++)
var = a[i];
}
B
main(){
int i, b[50];
for(i=0;i<50;i++)
b[i] =…

Bimp
- 494
- 2
- 5
- 14
1
vote
2 answers
Java IO (javase 6)- Help me understand the effects of my sample use of Streams and Writers
BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new BufferedOutputStream( new FileOutputStream("out.txt") ) ) );
So let me see if I understand this: A byte output stream is opened for file "out.txt". It is then fed to a buffered…

Daddy Warbox
- 4,500
- 9
- 41
- 56
1
vote
1 answer
Play writers additional property
Is it possible to write additional property unavailable in case class constructor?
case class Task(var name:String, var counter:Int) extends Entity
by extending by Entity case class have also id property
implicit val task = (
(__ \…

Michał Jurczuk
- 3,728
- 4
- 32
- 56
1
vote
2 answers
Readers Writers - Writer thread always stuck with multiple reader thread
New bie here.
I have been working on readers/ writers problem solution.
It works perfectly fine with 1 reader and 1 writer.
But when I modify reader to 2; writer thread always starves. Help me!
It seems Writer thread is stuck somewhere waiting for…

vipul
- 9
- 3
1
vote
1 answer
How to cause writer priority failure in readers writers solution?
I'm interested in causing a failure in the readers/writers semaphore solution, with writers priority.
In the following code, taken from Wikipedia:
READER
P(mutex_3);
P(r);
P(mutex_1);
readcount := readcount +…

user1487325
- 13
- 3
0
votes
1 answer
Spring Batch - write to 2 tables at once
I have a Person object that has a list of addresses. My Spring Batch app converts Person JSON recors into Person POJOs and writes them to a database.
Ordinarily, I'd use JdbcBatchItemWriter but I see it is limited in writing to 2 seperate tables. I…

TheCoder
- 8,413
- 15
- 42
- 54
0
votes
1 answer
running vssadmin from a program
I'm trying to run the following command from a c++ program:
system("vssadmin list writers > tmp.txt ");
I'm getting this output:
"vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft…

Y_N
- 11
- 3