Just for amusement, I implemented FizzBuzz. For some
reason, the 3rd one is off by one. Why? Procedural Smalltalk:
Functional-ish Smalltalk:
Ye-olde Array Indexing Hack with block
contexts:
I thought it might be a VW bug, but it works the same way in
Squeak. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Solved it! Sometimes zero indexing
might be nice! From: Peter Suk Just for amusement, I implemented FizzBuzz. For some
reason, the 3rd one is off by one. Why? Procedural Smalltalk:
Functional-ish Smalltalk:
Ye-olde Array Indexing Hack with block
contexts:
I thought it might be a VW bug, but it works the same way in
Squeak. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
I'm not quite clear on the use of the SQLite3ThreadedConnection class.
Currently I'm using its superclass (aptly named SQLite3Connection) in my Run BASIC appserver. I'm guessing that the threaded one is more appropriate for multiuser web apps, or do I misunderstand what this class is for? Should I be able to just substitute one for the other? Is there anything I need to be careful about? I hope someone here has some experience with it. :-) Thanks, -Carl Gundel Easy Windows programming - http://www.libertybasic.com Easy web programming - http://www.runbasic.com _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
If its anything like ODBC threaded connection, then the benefit is that queries in one connection don't block the vm and hence other activity in the image. Internally each connection is protected with a semaphore for thread safety, so most of the time you can just substitute one for another. There is significant performance penalty involved however, so beware, but depending on your use cases it may not matter or matter very little. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Performance may be an issue perhaps, but my interest in this class is that
it may prevent locking errors. Is it designed for that, I wonder? Thanks, -Carl Gundel Easy Windows programming - http://www.libertybasic.com Easy web programming - http://www.runbasic.com ----- Original Message ----- From: "Boris Popov" <[hidden email]> To: <[hidden email]>; <[hidden email]> Sent: Sunday, August 24, 2008 10:07 PM Subject: Re: [vwnc] Questions about SQLite3ThreadedConnection > If its anything like ODBC threaded connection, then the benefit is that > queries in one connection don't block the vm and hence other activity in > the image. Internally each connection is protected with a semaphore for > thread safety, so most of the time you can just substitute one for > another. There is significant performance penalty involved however, so > beware, but depending on your use cases it may not matter or matter very > little. > > Cheers! > > -Boris (via BlackBerry) > > ----- Original Message ----- > From: [hidden email] <[hidden email]> > To: vwnc-list <[hidden email]> > Sent: Sun Aug 24 18:49:31 2008 > Subject: [vwnc] Questions about SQLite3ThreadedConnection > > I'm not quite clear on the use of the SQLite3ThreadedConnection class. > Currently I'm using its superclass (aptly named SQLite3Connection) in my > Run > BASIC appserver. I'm guessing that the threaded one is more appropriate > for > multiuser web apps, or do I misunderstand what this class is for? > > Should I be able to just substitute one for the other? Is there anything > I > need to be careful about? I hope someone here has some experience with > it. > :-) > > Thanks, > > -Carl Gundel > Easy Windows programming - http://www.libertybasic.com > Easy web programming - http://www.runbasic.com > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Carl Gundel
I just completed a test application using SQLite, both threaded and
unthreaded. Performance issues aside, the threaded version does not work well when, within a single image, you have one Smalltalk Process (and hence OS thread) writing frequently to the database while a separate Smalltalk Process (and hence OS thread) tries to read extensively from the database at the same time. Database errors occurred from which the threads could not recover. There were no OE crashes, though. It appears that the difference between SQLite3ThreadedConnection and SQLite3Connection is that the non-threaded version ends up calling a bunch of external library methods while the threaded version calls the same methods but use the _threaded "keyword" in their invocations. Chris Carl Gundel wrote: > I'm not quite clear on the use of the SQLite3ThreadedConnection class. > Currently I'm using its superclass (aptly named SQLite3Connection) in my Run > BASIC appserver. I'm guessing that the threaded one is more appropriate for > multiuser web apps, or do I misunderstand what this class is for? > > Should I be able to just substitute one for the other? Is there anything I > need to be careful about? I hope someone here has some experience with it. > :-) > > Thanks, > > -Carl Gundel _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Hi Chris,
is this a possibility with PostgreSQL also? I've been noticing slow performance in the database there also, What's your recommended approach? thanks, David On Mon, 2008-08-25 at 07:53 -0500, Chris Winemiller wrote: I just completed a test application using SQLite, both threaded and unthreaded. Performance issues aside, the threaded version does not work well when, within a single image, you have one Smalltalk Process (and hence OS thread) writing frequently to the database while a separate Smalltalk Process (and hence OS thread) tries to read extensively from the database at the same time. Database errors occurred from which the threads could not recover. There were no OE crashes, though. It appears that the difference between SQLite3ThreadedConnection and SQLite3Connection is that the non-threaded version ends up calling a bunch of external library methods while the threaded version calls the same methods but use the _threaded "keyword" in their invocations. Chris Carl Gundel wrote: > I'm not quite clear on the use of the SQLite3ThreadedConnection class. > Currently I'm using its superclass (aptly named SQLite3Connection) in my Run > BASIC appserver. I'm guessing that the threaded one is more appropriate for > multiuser web apps, or do I misunderstand what this class is for? > > Should I be able to just substitute one for the other? Is there anything I > need to be careful about? I hope someone here has some experience with it. > :-) > > Thanks, > > -Carl Gundel _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
david wrote:
Hi Chris,I doubt that PostgreSQL has the same problem because its access technique is entirely different. With PostgreSQL, the database has a "server" OS process to which clients connect over a TCP/IP socket. So, the image has a socket connection to the PostgreSQL database. And VisualWorks sockets seem very well behaved. We use PostgreSQL as our Store database and we've never had problems like the one I tried to describe below. Regarding PostgreSQL performance: I am no database expert. However, I do know that PostgreSQL has a "vacuum/analyze" command that you should send to the library periodically. This command is supposed to tune the database performance. PostgreSQL's documentation might have a better explanation. Regards, Chris
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Carl Gundel
PostgreSQL interface does not use DLLCC so there's nothing to add __threaded to. From: [hidden email] To: Chris Winemiller Cc: vwnc-list Sent: Mon Aug 25 06:16:17 2008 Subject: Re: [vwnc] Questions about SQLite3ThreadedConnection Hi Chris, is this a possibility with PostgreSQL also? I've been noticing slow performance in the database there also, What's your recommended approach? thanks, David On Mon, 2008-08-25 at 07:53 -0500, Chris Winemiller wrote: I just completed a test application using SQLite, both threaded and unthreaded. Performance issues aside, the threaded version does not work well when, within a single image, you have one Smalltalk Process (and hence OS thread) writing frequently to the database while a separate Smalltalk Process (and hence OS thread) tries to read extensively from the database at the same time. Database errors occurred from which the threads could not recover. There were no OE crashes, though. It appears that the difference between SQLite3ThreadedConnection and SQLite3Connection is that the non-threaded version ends up calling a bunch of external library methods while the threaded version calls the same methods but use the _threaded "keyword" in their invocations. Chris Carl Gundel wrote: > I'm not quite clear on the use of the SQLite3ThreadedConnection class. > Currently I'm using its superclass (aptly named SQLite3Connection) in my Run > BASIC appserver. I'm guessing that the threaded one is more appropriate for > multiuser web apps, or do I misunderstand what this class is for? > > Should I be able to just substitute one for the other? Is there anything I > need to be careful about? I hope someone here has some experience with it. > :-) > > Thanks, > > -Carl Gundel _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Carl Gundel
All recent versions of PostgreSQL come with autovacuum daemon, just make sure its enabled in your configuration. From: [hidden email] To: vwnc-list Sent: Mon Aug 25 06:47:57 2008 Subject: Re: [vwnc] Questions about SQLite3ThreadedConnection david wrote: Hi Chris,I doubt that PostgreSQL has the same problem because its access technique is entirely different. With PostgreSQL, the database has a "server" OS process to which clients connect over a TCP/IP socket. So, the image has a socket connection to the PostgreSQL database. And VisualWorks sockets seem very well behaved. We use PostgreSQL as our Store database and we've never had problems like the one I tried to describe below. Regarding PostgreSQL performance: I am no database expert. However, I do know that PostgreSQL has a "vacuum/analyze" command that you should send to the library periodically. This command is supposed to tune the database performance. PostgreSQL's documentation might have a better explanation. Regards, Chris
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |