i read the data in BEFORE forking.
when you fork, each thread is a kind of replication of the original. via copyOnWrite the original data is shared. if one fork writes, it creates a copy of the original data and does its modifications. So no other fork can see the modification. sharing the data between different forks is expensive and slow
my idea was that since I only read the operating system shouldn't need to create copies (slow and requires memory), but after reading the answers here it seems that even with readOnly perl does enough writing to the data to let the OS start the copying :(
thats not nice but I guess I have to live with that and find other solutions like the in memory databases mentioned... | [reply] |