Hardware – various hardware existing or needed for a program. Architecture – how is the hardware put together. OS – an exact operating system.
Tree above – platform.
Program – actual binary running upon the platform. With PHP - the PHP interpreter.
A cross-platform program can be handled within the same source tree, or with different sources for different platforms. As well many interpreted programming languages supports multiple platforms. Also there are like a dozen platforms within Unix, Linux, Windows.
Access control lists and others vs UNIX permissions.
Unmapped UNIX user example – Samba, NFS, etc.
Atime is usually off by default off windows. On linux depends on a distribution, but most likely is on.
readdir() fileorder can differ not only between platforms, but also depends on filesystems.
symlink() with relative paths is not thread safe, threads could have changed the CWD.
realpath() might show different results depending on platform/OS. Fe case insensitive on Windows, case sensitive on Linux, optional case sensitivity on OSX.
TSC – time stamp counter, a 64-bit register on intel Architectures. The TSC frequency is not assumed to be constant, it is periodically tweaked, that is what the adjtimex system call is for. A user space program/daemon (like NTP and PTP) uses adjtimex to tell Linux how to slew the frequency over time.
A periodic procedure calibrates the TSC frequency and the period is given by the RTC (system clock)? So the change of the TSC counter is compared to an elapsed time of the RTC (system clock). Thus the resulting TSC frequency is calibrated to give exactly one million microseconds/second
PM clock – power management clock rate, might depend on ACPI – advanced configuration and power interface
HPET – high precision event timer
POSIX clock – standard for implementing and representing time sources, abstraction layer
Usleep() … system call, posix monotonic clock vs performance timer … mention hrtime here
Timeout counting on Linux doesn’t include time spent for syscalls, f.e. for sleep(). On Windows, timer is running in parallel with the PHP script execution.
Opcache ASLR issue on Windows
Various shared memory issues in NTS builds.
Under Linux shared memory is accessible between processes, Windows it's not always the case. Especially it's to mention for ACRL cases.
Like SQL query cache.
PGO – profile guided optimization LTO – link time optimization FDO – feedback directed optimization
Windows x64 no inline ASM PHP targets SSE2 on x86
make clean make -j4 prof-gen # run training scripts make prof-clean make -j4 prof-use
configure –enable-pgi nmake # run training nmake clean ./configure –enable-pgo nmake
Big file uploads count for LFS as well.
A combination of 32-bit processes running on 64-bit OS – the processes are still a bit slower that on a native 32-bit OS, but can use their 2GB memory limits.
Stack pointer Registers Scheduling properties (such as policy or priority) Set of pending and blocked signals Thread specific data.
Shared file descriptors and co.
Most of the dead stuff was removed in PHP7, embed can be used in any userspace programs, also used in several servers, fe NaviServer (former AOLserver).
Classic model when learning socket programming.
A good example for cross platform thread locking is APC. Cross-platform threading is possible with pthreads.
And mention globals in php7 are TLS based as well, but actually it’s a bigger topic which can turn into a sleeping pill
In php7 it opens the door for better binary compatibility, because in many cases a thread specific global variable can be used instead of extending the extension globals structres. This can be a big salvation for bug fixes in the middle of some stable release.
TS less robust, more sparse servers can be started.
mail() isn’t thread safe until PHP7 on windows Locale is not thread safe mt_rand() might work not in the range expected symlink vs. junction Getenv()/putenv() isn’t thread safe. Fe #69636 . This has an alternative threaded API on windows, but no chance on linux.
“We are only as strong as we are united, as weak as we are divided.”
#php.pecl on efnet
#winphp-dev on freenode
PHP 7.0 release manager
PHP core developer
• chmod(), chown(), etc.
• process permissions are handled same way as file ones
• Unmapped UNIX users built-in SID mapping
• ext3, ext4 and others
• noatime,nodiratime in /etc/fstab
• fsutil behavior query DisableLastAccess
• fsutil behavior set DisebleLastAccess 0
C:tmp> echo hello > foo.txt
C:tmp>echo world > foo.txt:bar.txt
C:tmp>dir /r foo.txt
Volume in drive C is SYSTEM
Volume Serial Number is AE0A-76BD
Directory of C:tmp
08/31/2015 11:50 PM 8 foo.txt
1 File(s) 8 bytes
0 Dir(s) 59,944,050,688 bytes free
PHP FS snippet 3
$f = fopen("file.txt", "w");
Warning: unlink(file.txt): Permission denied in Command line code on line 1
PHP FS snippet 4
Warning: fopen(some/directory): failed to open stream: Permission denied in
Command line code on line 1
resource(5) of type (stream)