Paul Sun

Greenhorn
+ Follow
since Aug 26, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Sun

I think you should create thread for each client
on DB Server.
Hi:
First, I want to apperciate for everyone's
help on this site. It is really a greate site.
I did the assignment by socket. I may not be
a good choice. At least I passed.
Thanks in advance.
Paul
19 years ago
Hi:
I meet a problem of lock. For example, A,B and C
want to book the same ticket at the same time. Then A will book it and B,C are locked. But when the lock is released by A, lockManager will notify all members, B and C. So that, B and C will try to book it at same time. I think, I need to create a FIFO array to store waitting members and let them book ticket in order. Please give me some advice. Thanks.
Paul
Hi:
I do the assignment with socket. I meet a problem that how to check if server is online?
In this application, if server shutdown and restart again, client should re-connect it again.
Thanks.
regards.
Paul
Hi:
I think client wait for reply may not be a only way but at least it is simple to implement.
To image that you book tickets on web site,
after push book button on a web page, you have to wait the response. Can you book an ticket or do other things at that time? I think you can not.
ok, I make it wait until the reply arrive.
Thank you for reply. You give me a great help.
Paul
Hi:
I can not work it out. If I make user wait reply and can not input( or other things) until info received from server, is it all right?

Is there somebody implement assignment with sockt?
Paul.
Hi Michael:
Thank you for your reply. But the problem is my design is view -> model -> dbclient, I have used Observer pattern on view-model, the model class extends Observable, so that I can not use it on
db client and model. And the db client is not a thread, when client need send data to server it will be called and work for it. So if client wait for the reply continuelly, user can do nothing at that time.
Thanks.
Paul
Hi:
I am using socket to implement the assignment.
I asked a question about lock/unlock before,
With member's help, I do it in the background on
server side. But I am confused on how to notify client after unlock. Because I use socket, if the client wait for reply, code like this
while( true ) {
fromServer = in.readLine();
}
the client have to do nothing until the result of booking ticket come back. How to implement it?
Thanks.
Paul
Hi Dennis:
Thanks. I put wait/notify method into LockManager, a object take charge of locking record, it can work so well.
Thank you.
Paul.
What does mean "same object". I think thread A want to lock a record, but thread B lock it at that time, so A will wait until B unlock it and
notify A. Am I right?
Hi Everyone:
I use wait/notify to implement lock/unlock function. but the thread waitting to lock record is not notified. Why?
Thanks.
Hi:
Could someone tell me how to test lock/unlock
function?
Thanks.
Paul
I read some aritcles about MVC design pattern.
The model should notify view when its data
are changed. I want to know how to implement
it. Can I use Observer pattern implement it?
BEST REGARDS.
Paul
Hi Michael:
I have another question. If you access db by way of running a thread in background, what does client do at that time? show a message or do nothing?
:roll:
Hi Michael:
Coult you tell me details about how to implement
background thread?
Thanks.
Paul.