fadzizo abdullah

Greenhorn
+ Follow
since Apr 28, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by fadzizo abdullah

hi Ajay...good morning and i hope you are fine

it has been quite a long time not messaging each other right...huhhhh so many things happened...

alright, back to our previous discussion....emmm i'm quite confused...did you mean that i should not use the while looping structure that puts my parent thread in a busy state? and, i must change it to another better way as what you have suggested to me?

if that is so, im still not getting the answer of your last post....to terminate/ stop threads other than the finished one...could you please guide me more??

thanks in advance
15 years ago
hi Ajay...

emmm im quite confused here...actually i did read about wait() and notify(), but they are all used in synchronizing some threads so that they can work together when accessing the same object....in my case request from a client will be spawned to some servers....means that one thread for one server.... the threads didn't share the same object since they target different servers...

as these lines mean:



and, then i need to wait till ONLY ONE of the threads finished WITH A RESULT...as these lines mean (i think the || operator should be changed to &&):



once any ONE of the threads finished and the loop stops, i will extract the data from the finished thread by doing this:



please guide me and correct me....thanks in advance...
16 years ago

Ajay Saxena wrote:You are very close to the solution!



happy to hear that....

ok, i will try my best push up my effort more and more.....i will post again my new progress soon...thanks a million Ajay....
16 years ago
hi Ajay...

thanks for your reply and information...

back to our previous discussion....

Ajay Saxena wrote:
However,the solution is far from complete as you want the response to be generated when one of the threads is done with its job.
In the current implementation the three threads are being spawned by the parent thread and it's not blocking on the child threads.

Designing a solution where you would like the parent thread to block only till ONE of the threads is done,and then probably interrupt the remaining threads would be tricky.



i think i have found a solution, but i need your comments...i put it this way....i used a while loop to check whether or not the thread has done...if done, i called a getPwd() which returns a data of the process done in the thread:



and, in the class DataAccess i added another variable "done" to indicate whether or not the process has finished:



ok, so am i on the right track...?? thanks in advance....
16 years ago
hi Ajay...

a bit late reply from me since i got flu (not that H1N1 ) these four days...now im recovering....but stil quite dizzy...

so you mean that it is enough with that one server (servlet app) to service all requests....?? and yet i can still have a distributed architecture where there can be some databases resided in several computers serviced by that single server (servlet app)..??

im sorry if i got it wrong.....thanks in advance
16 years ago
hi ujjwal

1. why i need to change CLDC 1.1 to CLDC 1.0....?? im using CLDC 1.1....
2. do i need to delete any setRequestProperty() in order to put the suggested ones...??

thanks in advance...
16 years ago
hi Ajay....

i want to ask for your opinion....if i just use servlet without rmi means that i leave the processing burdens all to the servlet only...what if there are so many requests...??

in my thought, if i use rmi i will divide the processing into some parts, lets say i have 4 servers with the same database in each, and users request to do something, so 1st server do the 1st quarter, 2nd server for 2nd quarter, and so on....now, one problem divided into four worker instead of using on worker only (the servlet only).....

thanks in advance...
16 years ago
Hi guys…

I’ve developed a midlet to store captured image from the phone’s camera into a database located on a server. At the server side, servlet is used to accept the captured image from the midlet and store in into the database.

The problem is, when I tried to retrieve the captured image and view it back on my midlet, half of the image became black except only small portion of the upper part of the image was ok.

Here are the code segments:


Midlet codes:


Servlet codes:


I hope you guys can help and guide me….thanks in advance
16 years ago
hi Ajay

emmm ok, so up to this point i've done it correctly right....

alright, i'll work on the next tricky parts...if i got something to ask, i hope you'll be here to guide me again....thanks a million to you Ajay....till then, God bless you always....
16 years ago
hi Ajay....thanks for your concern....

is this what you mean...?

16 years ago
hi Ajay

thanks for your previous reply....ok, it's true that i can just use a servlet alone without the rmi part...but the answers why im using RMI are:

1. my database will be located in several servers (workers) or in another word i have replicated databases (same records in all databases in all workers).

2. im using servlet as a communication service between my client and rmi workers.

3. im using multithreading to enhance searching performance. Searching will be using horizontal partitioning. Client will request something to be searched, received by the servlet, broadcast the request to all workers (to me this is the multithreading part of what we have discussed yesterday). The first worker returns with the data will be accepted (don't know how to do this part yet ), the data will be sent to the client, and the searching processes will be stopped for the rest of the wokers (don't know how to do this part yet).

4. so, my architecture would be Client <-> multithreaded Servlet <-> RMI <-> Database

Ajay, i would really appreciate if you could give some comments and guidance of what im trying to do...thanks in advance...
16 years ago
thanks Ajay

emmm i think i need to use wait() in order to suspend and wait till all the threads are done...ok, i'll find it first and once i found it i'll post it here for you to give guidance ok...

but before that, i got two things to ask you that keep me wondering about:
1. are the people out there use the same way im using now (servlet + rmi + multithread)?
2. is my method of combining the servlet + RMI + multithreading good for my system as mentioned in the first post above (multiprocessed-based searching application using servlet)? any other better alternative?

thanks Ajay, may God bless you...
16 years ago
hi Ajay.... thanks for your quick reply....

ok here are the codes that i have modified just now...is this what you mean?

16 years ago
thanks guys...

Ajay...

do you mean:
1. i need to write the class RMICaller in the servlet and then invoke the class within the servlet..? or
2. no need to use the servlet, instead just use the class RMICaller...?

actually i still need to use the servlet....it is a compulsory part of my system...
16 years ago
hi all

im developing a client/server application to perform data searching on some workers' database (some PCs)...on PC A i use RMI to call remote objects on PC B and PC C... PC A actually contains a Servlet program...i managed to implement this on one-to-one basis... now, im trying to use Thread on PC A so that it can make concurrent call to PC B and PC C....i don't want my program on PC A to call remote objects from the other two PCs sequentially....im intend to develop something like multiprocessing application...

So guys, do you think im doing the right thing...?? any ideas or opinions about my above intentions...?? Below are my programs...it worked fine JUST FOR the first running time....when i tried to call the Servlet again while it's still running, it's not working....

here is my program on PC A:




This is my program on PC B:

>
16 years ago