Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3233762
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:18:51+00:00 2026-05-17T17:18:51+00:00

i am currently working on an MVC webframework with a very special feature. Layouts

  • 0

i am currently working on an MVC webframework with a very special feature.
Layouts defined in XML files are seperated into content blocks that can be arranged/cached/loaded individually.

Every content block (this could be e.g. the footer which is re-used on several pages) has some sort of Controller of its own. I call it Blockcontroller.

This controller executes relevant code (including DB requests via resource Models, external API requests via an HTTPclient model and so on).

The framework is designed to be used in very complex environments where multiple datasources are involved. This will expecially be several Database servers and REST apis.

Now the goal is to execute such Content blocks concurrently to speed up page delivery.

Example:

A Webinterface needs to fetch your address book from Google Mail, Facebook, Twitter and 10 other sources, do some matching and calculations.
Every requests takes about 1 second.
This adds up to 15 seconds if done sequentially.

The goal is to define a block for everything (yeah this should rather go in to a model but i want to keep it on the block level as most of the logic is defined in this xml files. they just generate no output then.) and set the “concurrent execution” flag to 1.

The last content block that assembles everything those concurrent Blocks as required attribute, so it begines to execute when they are all done and the data is available. Something like this:

<block template="blank.phtml" block="twitter.php" concurrent="1" name="twitter"/>
<block template="blank.phtml" block="gmail.php" concurrent="1" name="gmail"/>
<block template="blank.phtml" block="facebook.php" concurrent="1" name="facebook"/>
<block template="stats.phtml" block="statistics.php">
    <depends>twitter</depends>
    <depends>gmail</depends>
    <depends>facebook</depends>
</block>

The parser essentially has a look at the layout xml fiels first and scans for blocks that are marked for concurrent execution and assembles an array with a queue, and every queue point can have multiple entries. they are arragend in Dependency order.

So if something has no dependency it definately goes into the queue group at the very first position. Everything that depends something from this group goes into second positino and so on…

Data is stored into a singleton model.

My problem now is that it works fine with mod_cgi or mod_fastcgi for php, but it just messes all up with apaches mod_php.

I googled a bit and read that you should never use pcntl_fork with mod_php …
is there any alternative?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:18:51+00:00Added an answer on May 17, 2026 at 5:18 pm

    Instead of forking, use proc_open to run each block as different scripts on the command-line. This is not possible on all web hosts but maybe you have your own server anyway?

    You cannot fork in mod_php because that will create an entirely different Apache process. It’s really difficult to do concurrent work in mod_php, but it’s doable (as I said) with proc_open.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on an asp.net-mvc content management system. It would be incredibly useful
I am currently working on my first asp.net mvc application. I am trying to
I'm currently working on a blog application in ASP.NET MVC. I can't quite figure
I'm currently working on an ASP.NET MVC project using NHibernate and I need to
I'm currently working on a reasonably simple MVC app which allows the user to
I'm currently working on an Asp.net MVC Web application. In my solution, there're two
I'm currently working on an ASP.net MVC web site project. I've put all database
I am currently working on my own implementation of a MVC framework. I would
I am currently working on another issue in my ASP.NET MVC project. In an
I am currently working on a project that consists of an ASP.NET MVC 2.0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.