In App Engine Java development server, how do I simulate concurrent threads for safety?

1 view
Skip to first unread message

Patrick via StackOverflow

unread,
May 11, 2012, 9:12:36 PM5/11/12
to google-appengin...@googlegroups.com

I read that Google App Engine Java development server only runs one servlet thread.

I would like to simulate two threads running in parallel so that in debug mode I can pause one of them and observe the correct behaviour of the other.

Is this possible at all? In what other ways can I simulate such a scenario to test for thread safety?

(in particular, I am trying to observe the behaviour of jdo transactions)

p.s. I do have <threadsafe>true</threadsafe> in appengine-web.xml



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/10559602/in-app-engine-java-development-server-how-do-i-simulate-concurrent-threads-for

bowmanb via StackOverflow

unread,
May 11, 2012, 11:22:35 PM5/11/12
to google-appengin...@googlegroups.com

If dropping to the command line is acceptable, you could open two terminals and use cURL in each to hit your servlet.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/10559602/in-app-engine-java-development-server-how-do-i-simulate-concurrent-threads-for/10560801#10560801

Patrick via StackOverflow

unread,
May 12, 2012, 1:47:37 AM5/12/12
to google-appengin...@googlegroups.com

I read that Google App Engine Java development server only runs one servlet thread.

I would like to simulate two threads running in parallel so that in debug mode I can pause one of them and observe the correct behaviour of the other.

It seems that when I place a breakpoint, and make the call from two different tabs in Chrome, only one of them breaks.

Is this possible at all? In what other ways can I simulate such a scenario to test for thread safety?

(in particular, I am trying to observe the behaviour of jdo transactions)

p.s. I do have <threadsafe>true</threadsafe> in appengine-web.xml



Patrick via StackOverflow

unread,
May 12, 2012, 1:52:39 AM5/12/12
to google-appengin...@googlegroups.com

Ok. The problem was different all together. It must have been Chrome that didn't like sending more than one request to the same server while one was hanging. Sending one from Chrome and another one from Firefox did it. So after all, the Google App Engine Java Development server can handle concurrent requests by different threads. what I read, was wrong.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/10559602/in-app-engine-java-development-server-how-do-i-simulate-concurrent-threads-for/10561407#10561407
Reply all
Reply to author
Forward
0 new messages