Schedule Task Error

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

jackygu
Posts: 34
Joined: 13 Jun 2008, 17:35

Schedule Task Error

Postby jackygu » 29 Jun 2013, 10:08

Hi, lapo,
I use schedule task as following:
mainExtension run a schedule task B_Extension, after B_Extension finish the task, call the mainExtension function: handleRequest(), the the following error happen.

jvm 1 | java.util.ConcurrentModificationException
jvm 1 | at java.util.LinkedList$ListItr.checkForComodification(Unknown Source)
jvm 1 | at java.util.LinkedList$ListItr.remove(Unknown Source)
jvm 1 | at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.executeTasks(Scheduler.java:327)
jvm 1 | at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.run(Scheduler.java:223)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
jvm 1 | at java.lang.Thread.run(Unknown Source)

Pls inform how to solve, thanks.

jacky
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Schedule Task Error

Postby Lapo » 09 Jul 2013, 07:28

The problem is not with the Scheduler. You are modifying a LinkedList from two threads at the same time, which causes the data in the List to corrupt.
You will need to synchronize access between threads.
See here:
http://stackoverflow.com/questions/1241 ... linkedlist
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 35 guests