473,385 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Synchronization in PHP ??

Does exist any form of synchronization in PHP??
Namely locks, mutexes, semaphores, monitors, etc...

Thanks in advance.
Regards.
Mar 17 '08 #1
5 2749
PHP has an interface to SysV semaphores:

http://www.php.net/manual/en/function.sem-acquire.php

flock is also available for file-based inter-process synchronization.

On Mar 16, 11:52 pm, Hermann <Hermann.Rich...@gmail.comwrote:
Does exist any form of synchronization in PHP??
Namely locks, mutexes, semaphores, monitors, etc...

Thanks in advance.
Regards.
Mar 17 '08 #2
Hermann wrote:
Does exist any form of synchronization in PHP??
Namely locks, mutexes, semaphores, monitors, etc...

Thanks in advance.
Regards.
What kind of synchronization are you trying to do?

In general, PHP scripts don't talk to each other like they can in other
languages. There is a limited interface, but it's system dependent. So
there are some things you *can* do in PHP, but PHP may not necessarily
be the *best* language to do them in.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Mar 17 '08 #3
petersprc wrote:
PHP has an interface to SysV semaphores:

http://www.php.net/manual/en/function.sem-acquire.php

flock is also available for file-based inter-process synchronization.

On Mar 16, 11:52 pm, Hermann <Hermann.Rich...@gmail.comwrote:
>Does exist any form of synchronization in PHP??
Namely locks, mutexes, semaphores, monitors, etc...

Thanks in advance.
Regards.
and if interfacing to Mysql, there are lock facilities in that.

Mar 17 '08 #4
Jerry Stuckle wrote:
Hermann wrote:
>Does exist any form of synchronization in PHP??
Namely locks, mutexes, semaphores, monitors, etc...

Thanks in advance.
Regards.

What kind of synchronization are you trying to do?

In general, PHP scripts don't talk to each other like they can in other
languages. There is a limited interface, but it's system dependent. So
there are some things you *can* do in PHP, but PHP may not necessarily
be the *best* language to do them in.
Quite.

If you have some heavy realtime interactive-across-many-web-interfaces
type problem, the better answer is to use php to do the user interface
parts, and have some core daemon written in 'C" or suchlike handling all
the interactivity bits.

And write a PHP extesnion to access it.
Mar 17 '08 #5
Alright guys. Perfectly clear. Thank you all by your replies.

I just need to do an atomic test-and-set in a MyISAM table (a global
shared variable for the whole website).
But I think it would be better if I use a shared variable. Those that
are provided by php caching packages.
Actually, I read that eAccelerator has a lock function in its API, so
that would be perfect.
Mar 17 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: WebRod | last post by:
Hi, i am tyring to find a solution to synchronize 2 environnement for months!! How do you synchonize one (or several!!) production environnement from DEV???? I am looking for a software...
5
by: Cyrus | last post by:
I have a question regarding synchronization across multiple threads for a Hashtable. Currently I have a Threadpool that is creating worker threads based on requests to read/write to a hashtable....
4
by: scott | last post by:
hi all, Thx to any one that can offer me help, it will be much appreciated. iv got a multithreaded program and need to use thread synchronization. The synchronization does not have to...
0
by: Rod | last post by:
I orginally posted this to microsoft.public.sqlserver.ce but had not received any responses. I have a CF.NET application (C#) with a SqlCE database. We had originally planned to use SQL...
5
by: fei.liu | last post by:
Hello, in the application I am developing, I am having trouble to synchronize event triggered actions using 'lock(ob){...};' technique. Here is a outline of my code: class C{ int x = 0; public...
12
by: emma_middlebrook | last post by:
Hi Say you had N threads doing some jobs (not from a shared queue or anything like that, they each know how to do their own set of jobs in a self-contained way). How can you coordinate them so...
0
by: lbrtchx | last post by:
Say you need to serve the same Web content from a number of IP address, which you need to keep out there with high availability requirements ~ I think Web Services would be a good candidate for...
0
by: sundman.anders | last post by:
Hi all! I have a question about thread synchronization and c++ streams (iostreams, stringstreams, etc). When optimizing a program for a multicore processor I found that stringstream was causing...
3
by: CKKwan | last post by:
Dear All, Can synchronize a class, any function is called and the entire class is locked. Can synchronize a method What if I need to Lock a class only when specific method is call?
15
by: ingejg | last post by:
I am starting to study internet synchronization, and my head is still spinning since internet is not my forte, however my boss is breathing down my neck at the moment. Our company has only one...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.