I really like how the workers are now, are not exactly as threads and do their job. If you make specialized workers for each job from your application, all will run smoothly and never go in "unresponsive script" error. I really like that I can to just "pass" some work from main javascript code to a worker and don't care about it. When it is done, I will get a message.
Yes, that can be made more complex to have transactions with isolation levels and waiting queue for lock releasing, but I think this is beyond of scope of gears. And why are you still on PHP? I tried RoR 3 years ago and never looked back at PHP. On Aug 4, 6:35 pm, jungleforce <[email protected]> wrote: > Opps, I meant to add sample code to the last post. > > ie. > sql = 'SELECT rowid,* FROM test WHERE col1 = ?'; > rs = db.execute(sql,['a']); > while(rs.isValidRow())[ > sql = 'UPDATE test SET col2 = ? WHERE rowid = ?'; > db.execute(sql,['1',rs.fielByName('rowid')]); > > rs.next();} > > rs.close(); > > In a statement like this, in general I shouldn't have a problem except > when I have 2 threads trying to do the same thing, which is when I > should push all db access code into a single thread. Right? I'm used > to programming in PHP where I can pretty much get away with murder. > It's been a long time since I've had to be careful about threading. > > I'm probably going to get flamed for this one, however, I wonder if > the db commands couldn't be make thread safe so that programmers > wouldn't have to repeat this code pattern. > > BTW, thanks for the feedback. > > On Aug 4, 10:58 am, jungleforce <[email protected]> wrote: > > > Within one thread if I do a SELECT call and than UPDATE or DELETE > > records from the same table as the SELECT call that I'm iterating > > through, I shouldn't have a problem right? It's only when another > > thread also tries to make a request while another thread is iterating > > through the database and making changes that I would run into trouble, > > right? It's usually on an UPDATE statement that I run into lock > > problems. > > > ie.
