Re: Perl threads under Windows
[email protected] ("Octavian Rasnita") Sun, 20 Apr 2008 10:09:46 +0300
| Newsgroups | perl.ithreads |
|---|---|
| Message-ID | <003201c8a2ba$6cf6a7a0$c2a2b451@teddy> |
I understand that the perl threads (at least under Windows) are actually a kind of separate processes that don't share the memory unlike the Windows native threads, and that's why they are not so slim as the Windows threads and why they can't share objects. Octavian ----- Original Message ----- From: "Chris Fowler" <[email protected]> To: "Dean Arnold" <[email protected]> Cc: "Octavian Rasnita" <[email protected]>; <[email protected]> Sent: Sunday, April 20, 2008 2:36 AM Subject: Re: Perl threads under Windows > Another suggestion is to share the DB connection info like host, user, > database, passwd, etc. Then in the thread open, execute, close. This > has worked for me. > > db handles can be used in a perl program that is threaded. you just > can't share a db handle between threads. I don't think they work across > a fork either. > > > > > On Sat, 2008-04-19 at 14:33 -0700, Dean Arnold wrote: >> Octavian Rasnita wrote: >> > >> > Passing messages to a window might not seem very complicated, but if >> > there are more windows, and many rules based on admin's preferences, on >> > user's schedule, or by user's request, might make the program a >> > spaghetti application. I think what I want to do should be a very >> > common >> > client-server application. Do you know if I could find somewhere such >> > sample apps made in perl? >> > >> >> My suggestion is to try perlmonks.org and do a super >> search for "Tk threads"; its been discussed and >> coded there numerous times. Here's the most recent: >> >> http://www.perlmonks.com/?node_id=522177 >> >> FWIW: you might take a look at Thread::Apartment to see >> if you can wrap Wx in its own thread, and make it >> look like you're passing objects around. I'd started to >> create a Tk::Threaded for Perl/Tk based on that, but >> it needs inter-thread tie()'d operations, which aren't available >> via the current ithreads environment. >> >> - Dean >