Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15230 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72002 invoked by uid 1010); 28 Feb 2005 18:48:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71987 invoked from network); 28 Feb 2005 18:48:13 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 28 Feb 2005 18:48:13 -0000 X-Host-Fingerprint: 213.131.2.2 nsrd.sinp.msu.ru Linux 2.4/2.6 Received: from ([213.131.2.2:2344] helo=nsrd.sinp.msu.ru) by pb1.pair.com (ecelerity HEAD r(5124)) with SMTP id 4F/82-43672-D6763224 for ; Mon, 28 Feb 2005 13:48:13 -0500 Received: from vvs_php (helo=localhost) by nsrd.sinp.msu.ru with local-esmtp (Exim 4.30) id 1D5qG5-0000ZH-I9 for internals@lists.php.net; Mon, 28 Feb 2005 22:08:45 +0300 Date: Mon, 28 Feb 2005 22:08:45 +0300 (MSK) To: internals@lists.php.net In-Reply-To: <42233717.9050107@akbkhome.com> Message-ID: References: <2005022807371112877%drbob@TheManFromSPUDcom> <42233717.9050107@akbkhome.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [PHP-DEV] How to embed PHP5 into multi-threaded C app? From: vvs_php@nsrd.sinp.msu.ru (Vadka) On Mon, 28 Feb 2005, Alan Knowles wrote: > these still need tidying up alot, but the do work. > http://docs.akbkhome.com/php_embed.c.txt > http://docs.akbkhome.com/php_embed.h.txt > replace the code in php_embed with them, make sure you compile with the zts > enabled, and the macros's are similar to the original embed (use threaded > start call at application start up, and thread start /start end within the > pthread_start(...callback..) method Thread safeness is not a problem for a single thread. The problem is to call user functions from different threads (tsrm_ls pointed to somewhere in different threads, global vars etc are not protected).