Fork and parforeach

hi all,
diff between fork and parforeach
regards,
krish

Hi Krishna,
The exact difference is static and dynamic. I mean when you know the exact number of incoming messages where by you want do some process on each message then you can use Fork else you can use Block with mode ParForEach
ParForEach :
parforEach is used for Mode property with Block step in Integration process.
Block is used for to combine steps that you want to execute one after the other and which are to access the same local data .You can also use a block to combine steps that you want to have the same deadline or exception handler, or to define a local correlation.
In a dynamic mode, the block is executed for each line of a multiline container element. In ParForEach mode, an instance of the block is generated for each line of the multiline container element. All instances are processed simultaneously. In ForEach mode, the block first runs through for the first line of the multiline container element, then for the second, and so on.
You can use the ParForEach mode when you want to send a message to multiple receivers simultaneously, for example. To do so, you use a receiver determination step to determine a multiline container element with the list of receivers. You then define that the message is sent to these receivers in a block with the ParForEach mode. You can use the ForEach mode when you want to send a message to multiple receivers one after the other, for example.
You specify the multiline container element in the Multiline Element attribute. In the Current Line field specify a container element that takes the value of the multi-line container element for which the block will run.
You can define an end condition for the dynamic mode (see also: Condition Editor). This is checked as soon as the block has run through for one line of the multiline container element. The block is complete as soon as one of the lines of the multiline container element returns true for the end condition, or all lines of the multiline container element have been processed.
For more details see the link
http://help.sap.com/saphelp_nw04/helpdata/en/ce/bb2c421f3fda2ce10000000a1550b0/frameset.htm
Fork
You use a fork when you want to continue a process in branches that are independent of each other.
Please see the following link.
http://help.sap.com/saphelp_nw04/helpdata/en/ce/bb2c421f3fda2ce10000000a1550b0/frameset.htm
Regards
Chilla..

Similar Messages

  • Fork and block

    hi all,
    what is the diffreence btween fork and block?
    regards,
    keerthi

    Hi Keerthi,
    Fork : when you want to continue a process in branches that are independent of each other and the branches of the fork join in a union operator.You can define the required number of branches to continue the process.
    Block: You can define the mode Parallel For Each(ParForEach) for a block or Dynamic Sequence (ForEach). This means that the block is executed for all elements of a multi-line container element.
    Check this link for all step types :http://help.sap.com/saphelp_nw2004s/helpdata/en/0f/80243b4a66ae0ce10000000a11402f/frameset.htm
    You can check it out how these step types will use in the process from SWC -SAP BASIS of the namespace http://sap.com/xi/XI/System/Patterns.It would gives the overall idea on BPM and you can find out the needful blogs from this forum.
    Cheers
    Veera

  • Fork and Muliple Conditions

    Hi Experts,
    What is the difference between the Fork and Muliple Conditions?
    Thanks.

    VJ.
    Multiple condition: you define a condition for each processing branch.
    Fork: each branch is processed paralel.
    See <a href="http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4b74f453d11d189430000e829fbbd/frameset.htm">Sap Help</a> for more information.
    Regards,
    Jasper

  • SunMC - Process is forking and reaping child processes. What's that?

    Hey folks,
    Im really new to the sysadmin world, and I think maybe my company really didn't think things well when they've decided to put me doing this, hehehe.
    I work with a general queue for which my team receives tickets with different kind of problems, among them, Automation Alerts (I think you all know what Im talking about).
    Recently (maybe 2-4 days) we've started to receive an Automation Ticket with the following message:
    Solaris Process Monitoring Process Monitoring Base03 CPU
    time for reaped children 107.1 30.0 Process is forking and
    reaping child processes.
    I've found almost nothing about this, and even when I think what's this ticket about (I've closed 2 or 3 of them stating no issues were found), I really want to understand and know where to look and if something can be done about this, because processes on the server and general state of it seems in good condition and nothing looks bad, apparently. The server is a Solaris 10 with zones.
    Can you shed some light on this? I'd appreciate all the help you can give me.
    Thank you and regards all.

    The same thought occurred to me, except I started seeing "failure" logs in JAMF the morning after we run maintenance policies. All of these failures were due to the Mac not restarting, which isn't really a failure - more of an inconvenience - since the second part of the policy (removing eTrust antivirus and restarting is part 1, installing SEP 12.1 and restarting is part 2) runs immediately on restart no matter what time of the day it is.
    In some cases the macs did not restart because the user had unsaved work or something else that would cancel logout. In this case, Casper prompts the user to restart and waits until the OK button is clicked, then counts down 1 minute and restarts. In the other case, nothing would have prevented logout yet the computer still did not logout and then restart, leading me to believe that the reason the Mac did not log out was a locked desktop, and since I am telling System Events to simulate a gui log out, this would be blocked by a locked desktop.
    The problem basically stems from the following two issues: 1. I am not to force a logout or restart when a console user is logged in and 2. Casper will not automatically log a console user out on it's own OR restart the computer if a console user is logged in - and then I have to rely on the end user to follow on screen instructions since the Casper restart prompt can be moved to the side and effectively ignored.
    When no restarts are required for the various policies we run, this is not an issue. And anyway, I originally just wanted to know what process is running when a desktop is asleep and locked, but no screen saver is active...

  • Danish terms for "data fork", "resource fork" and "resource map"?

    Any Danish speakers here who know the Danish terms for "data fork", "resource fork" and "resource map"?

    You got me thinking (never good on a Sunday), so I looked around and found this:
    http://www.whatiscalled.com/computer-terms-in-danish/
    I have bookmarked this!

  • BPM - two FORKS and a Transformation issue

    my scenario is File - BPM - Proxy
    input file has multiple records and each record has 1 field that we put a validation logic in.  There will be one message created for each record, so this is a 1:N Integration Process
    I used two Forks:
    Fork #2 has two branches: Branch 1 --> Transformation Step 3;     Branch 2 ---> Fork #1.
    Validation#1 = if the validation field has null value then it will go to Transformation Step3 along Fork#2 (end receiver is Proxy-C)
    validation#2 = if the field has value then it will go inside Fork#1 which has 2 branches: Transformation Step 1 (goes to Proxy-A) and Transformation Step 2 (goes to Proxy-B)
    I am testing a file with only the null value, so I am doing validation#1 only.
    I can see the message in BPE engine  (Outbound status = Processed successfully) but the message is stucked in the BPE
    I checked on the workflow log and here is what i see:
    1) Transformation Step 3 is executed (all mapping steps 1-4 completed so this is successful)
    2) Transformation Step 2 is executed (but mapping encounters an exception so this is not successful)
    3) Transformation Step 1 is not executed already because of the exception, and therefore Send Alert is triggered.
    It seems that all records of the file passes through all the branches, which is not intended.
    My intention is that when the validation field has null value that record will only pass thru Transformation Step 3,   if it is not null then record will pass thru Transformation Step 2 & 1.
    I already created a mapping for this validation, and when I test the Interface Mapping for Transformation Step 3 (consisting of 4 mapping steps) using an actual payload  it is successfuly generating the message.  - so no problem in this Interface Mapping.
    But on Runtime, BPM triggers exception due to validation#2 failing which again is because all records of file seem to pass on both Forks.  I want that when Validation#1 is true that specific record only passes in Fork#2   and not in Fork#1 also.
    I am using ParForEach.
    Can you kindly advise how to correct this issue?

    that was a very detailed explanation!
    But on Runtime, BPM triggers exception due to validation#2 failing which again is because all records of file seem to
    pass on both Forks. I want that when Validation#1 is true that specific record only passes in Fork#2 and not in Fork#1 also
    problem with your design...Fork seems to be working fine....you need to have a Switch block which will perform the validation and then route the message accordingly.
    I already created a mapping for this validation, and when I test the Interface Mapping for Transformation Step 3
    (consisting of 4 mapping steps) using an actual payload it is successfuly generating the message. - so no problem in this
    Interface Mapping.
    Mapping success does not mean that the BPM processing will be success.

  • Fork and BPM

    Hi
    I am using Fork in the BPM to collect and merge 3 messages. This is same as STD pattern "BpmPatternCollectMultiIf". It is working fine, it collects--> transforms --> sends. But always two PE are in "In process" state with a "clock" indicator. I tried putting Fork step inside a Block but no help. All receive steps uses a correlation to collect the messages.
    I am manually deleting the process instance in SWWL and processing next set of messages. We are using XI which is on Netweaver 2004s.
    Appreciate your help on this issue.
    Regards
    Prahllad

    Hi Murthy
    I have given the condition necessary branches =3, let me explain you how it is behaving.
    The first message arrives the PE instance is created and waits for another two messages. Once other two messages arrive the PE created by the first message goes to successful state and also all the message comes out merged into one message.
    But the second and third messages have also created the PE instance and they will be waiting for other two messages each..
    Where the end condition is for this, if necessary branches are 3 then all PE instances should end once merged message comes out of the BPM (or when the send step is executed).
    Please let me know any further help to resolve this issue.
    Regards

  • Fork and dynamic concurrency

    hi gurus ...
    I have 2 questions with regards to UML modelling. Someone told me that there is a symbol called 'fork' used with association diagrams. I haven't heard about such symbol. plz explain in brief. Further, what is dynamic concurrency and how can we show it through UML diagrams.
    Raheel.

    The "fork" is used in State Chart and its specialization, the Activity Diagram. Visually, it looks like a solid bar (it could be placed horizontally or vertically). The objective of the fork is to show concurrent lines of activities or executions. Typically a fork will have one line (representing a path of execution) coming on to it and two (or) more lines leaving it.
    Associated with fork is the "join", which represents joining of execution paths. A join, similar to fork looks like a solid bar but has more than one lines (execution paths) coming on to it and one leaving it.
    One significant condition to remember (which is also logical) is that all the lines of execution, which have been forked must join together somewhere. Usually we have one join for one fork, a one-to-one correspondence (logically).
    I do not quite understand the term "dynamic concurrency", concurrencies are by and large decided at design time (albeit, some may be conditional). If you have more information on this please share it with me, may be I can descern something.
    Hope this helps.
    Ironluca

  • SO OBJECT SEND and ParForEach Errors

    I updated a internal order workflow that used workflow initiator to determine the agent.  I changed it to a specific user instead.  I didn't get any errors in our development system, but when I moved the transport into our quality system, I received these two errors:
    Error when processing node '0000000120' (ParForEach index 000000)
    and
    Error '9' when calling service 'SO_OBJECT_SEND'
    I search through the forum but I didn't find anything that specifcally stated the reasons why they were getting the error and how they fixed it. 
    Any help would be appreciated.

    HI,
    This is a error with your binding. Check out the if the agent name is properly populated in the corresponding container using the workflow log. Check if the workflow is properly transported?
    check this link.
    [http://www.erpgenie.com/component/content/article/686]
    Let me know if you have any queries.
    Regards,
    Raj

  • Strip resource forks and .DS_Store files from folder

    I'm transferring stuff from my Mac to a Windows machine using a FAT32 formatted keydrive, and want to eliminate the various dot files from folders before I copy them to the Windows box. I had tried using a Terminal command, which was tedious and at one point I mistyped something and managed to nuke one of the folders on the drive. After a search, I found this script at MacOSXHints:
    on run
    display dialog "Drag a removable disk icon here to have it cleaned and ejected"
    end run
    on open selectedItem
    -- get a text version of the volume name and remove the trailing colon :
    set volumeName to selectedItem as string
    set volumeName to characters 1 thru (the (length of volumeName) - 1) of volumeName as string
    if (list disks) contains volumeName then
    do shell script "find '/Volumes/" & volumeName & "' -name '.DS_Store' -exec rm '{}' \\;"
    do shell script "find '/Volumes/" & volumeName & "' -name '._*' -exec rm '{}' \\;"
    try
    do shell script "rm -rd '/Volumes/" & volumeName & "/.Trashes'"
    do shell script "rm -rd '/Volumes/" & volumeName & "/.TemporaryItems'"
    end try
    try
    tell application "Finder" to eject disk volumeName
    end try
    end if
    end open
    It worked great, but took a bit of time to run. I no longer need to clean the whole drive again, just specific folders I add to the drive now. Unfortunately I don't actually know how to write Applescript, I can just sometimes adapt an existing script to my needs, but this adaptation is beyond my meagre abilities. Last night I was copying a couple of folders to the drive, then using the Terminal "find execute remove" command to get rid of the dot files after the fact. I would like to have an Applescript droplet, so that I drop the folder onto it and the resource forks are stripped off and the .DS_Store files are removed before I copy the folder to the key drive.
    Any help appreciated!
    Francine
    Francine
    Schwieder

    Make a duplicate of the folder you want to transfer on your hard disk, and then run the following on the duplicate:
    on open droppedItems
    repeat with anItem in droppedItems
    if (folder of (info for anItem)) is false then
    display dialog (anItem as string) & " was not proccessed." & return & return & "Folders only please"
    else
    do shell script "find " & quoted form of POSIX path of anItem & " -name \".DS_Store\" -exec rm '{}' \\;"
    do shell script "find " & quoted form of POSIX path of anItem & " -name \"._*\" -exec rm '{}' \\;"
    do shell script "ditto --norsrc " & quoted form of POSIX path of anItem & " '/Volumes/volumename/pathname/'"
    end if
    end repeat
    end open
    The second do shell script line may not be needed in this variation.
    (21517)

  • (SOLVED)fork() and memory sharing?

    Let me get this straight, when you fork() a child process this is what happens:
    A copy of the parent isn't made just yet-- instead the child has read only rights to the actual parent's memory page. Once the child executes a write call the stack and heap pages are copied and marked with read and write rights.
    Questions:
    What happens to the shared memory segments? Is this section shared prior and post to the copy/RW escalation? How does the stack, heap and shared memory segments differ?
    Last edited by Google (2010-08-25 16:01:17)

    Think of shared memory segments as their own entitites, truly separate from the process that created them.  They aren't copied during fork() because they are not technically part of the process's address space. 
    A pointer to the shared memory segment may be copied if one exists before you fork, which would allow the child to access the segment created by the parent, but the segment itself is ... well it's shared

  • Lightning Forks And Other Content Items Suddenly Lost Colour! Why?

    I was playing around with the 2 Lightning Forks which appear as blue and white.
    I had enlarged them and slowed them down to 50% and all was going well.
    Suddenly they lost their colour and appeared just white against the black background. I tried Undo several times but could not get the colour back. At the time I may have hit one or more keys accidentally but can't be sure.
    Then I added a new fork but that too was white.
    Different items from the Content were added and so were they!
    The only way I could get the colour back was to quit Motion and start a new project.
    As I was just experimenting nothing was lost but if I had been in mid-project it could have been serious.
    Any idea what I did wrong?

    if I have selected top only look at the alpha channel ( by pressing the shift key and the 'A' key at the same time) or maybe the Red channel ( by pressing the shift key and the 'R' key at the same time), I can get back to the showing full colour by pressing the shift key and the the 'C' key at the same time.
    hth
    adam

  • Runtime.exec() and fork() and Process

    So let me see if I understand this correctly, and if I don't please fill me in. If I call the following piece of codeRuntime.getRuntime().exec("chgrp rcsweb " + path+fs+orgName);
    Runtime.getRuntime().exec("chmod 660 " + path+fs+orgName);where path is the real path to a file, fs is short for File.spearator and orgName is the name of a file, then in the Unix environment, it will fork off a process.
    First, I seem to remember one forum topic that mentioned not forgetting about killing the process returned by exec, so I guess I need to add that to my code.
    Second, since I am forking off this process inside of a J2EE container, am I actually forming off the entire container, or just the Servlet where Runtime is called, or what?
    Third, how can I prevent the error java.io.IOException: Not enough space
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:54)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:546)
    at java.lang.Runtime.exec(Runtime.java:413)
    at java.lang.Runtime.exec(Runtime.java:356)
    at java.lang.Runtime.exec(Runtime.java:320)when I do not have the option of changing my VM size? Is killing the Process (and using waitFor()) going to take care of this issue?
    I appreciate your help.

    OK, after writing a few test programs, it is indeed clear..on unix (at least on solaris) when calling runtime.exec(..) The ENTIRE VM does indeed get forked. Therefore if your current Memory allocation for you VM is sitting at say 64MB (or you initial memory setting), another 64MB process will be created, even if you doing something as a simple
    exec("ls");
    I also tried putting runtime.exec call in its own thread hoping that if it was not in the main thread, that only that process would be forked..to no avail..the entire vm is indeed forked everytime...making runtime.exec damn near useless for server side work, and very dangerious..as you can essentialy assume you always need 2x your memory requirements.
    If anyone has figured out a workaround...any suggestions greatly appreciated.
    Some thoughts on some work-arounds
    1. Run 2 VMs (then when native calls are required..send a message to the 'native-calling vm' (insure its memory footprint is very low)
    2. Write your exec method via JNI (or does JNI calls also result in a fork of the vm on unix..)
    Test code below (threaded version)
    import java.util.*;
    import java.io.*;
    public class test5 extends Thread
         public void run()
              int loops = 0;
              while (true)
                   loops++;
                   System.out.println("---- iteration " loops "---");
                   makeNativeCall();
         public static void main(String[] args)
              try
                   System.out.println("testing on OS: " + System.getProperty("os.name"));
                   // Allocate a nice chunk of memory
                   byte[] bytes = new byte[1024 * 1000 * 50];
                   test5 tst = new test5();
                   tst.start();
                   while (true)
                        Thread.sleep(1000);
         catch(Exception e)
         {e.printStackTrace();}
    public void makeNativeCall()
              Runtime runtime = Runtime.getRuntime();
    InputStream stderr = null;
    InputStream stdout = null;
              OutputStream stdin = null;
    Process proc = null;
    long totalMem = (long)(runtime.totalMemory()/1024);
    long freeMem = (long)(runtime.freeMemory()/1024);
    long usedMem = (long)((totalMem - freeMem));
    System.out.println("VM REPORT: TOTAL(" totalMem") FREE("+freeMem+") USED(" usedMem")" );
    try
    proc = runtime.exec("sleep 1");
    stderr = proc.getInputStream();
    stdout = proc.getErrorStream();
    stdin = proc.getOutputStream();
    String line = null;
    int i = 0;
    String error = "";
    int exitVal = proc.waitFor();
    if (exitVal != 0)
    System.out.println("ERROR " +exitVal);
    System.out.println("DETIAL" +error);
    catch(Exception e)
    e.printStackTrace();
    finally
    if (stderr != null)
    try{stderr.close();}catch(Exception ignore){ignore.printStackTrace();}
                   if (stdout != null)
    try{stdout.close();}catch(Exception ignore){ignore.printStackTrace();}
                   if (stdin != null)
    try{stdin.close();}catch(Exception ignore){ignore.printStackTrace();}
    if (proc != null)
    try{proc.destroy();}catch(Exception ignore){ignore.printStackTrace();}

  • Fork process exception: enclosed small code and exception

    A code snapshot is enclosed along with the exception we are getting on our production system.
    My class file namely as StatementProcessParametersAction.saveParameters() method does following as enclosed the code snippet.
    CODE ------
         String val =   (String) request.getParameter("x");
         String jobId = request.getParameter("jobid");
         if ("1234".equals(val)) {
           try {
              Runtime.getRuntime().exec("java -classpath /export/bea/Mah-ARCS/ARCSDomain/cron ups.arcs.batch.ArcsBatchExecutioner http://arcsreport.inside.ups.com/ArcsContent/arcsinterfaceservlet processType statements command  " + jobId);
           catch (Exception e) {
               e.printStackTrace();
         }EXCEPTION ----
    ERROR 20 Mar 2006 09:04:53,569 StatementProcessParametersAction.saveParameters(): an unexpected error has occurred. Details: java.lang.UNIXProcess.forkAndExec(Native Method)
    java.lang.UNIXProcess.<init>(UNIXProcess.java:52)java.lang.Runtime.execInternal(Native Method)
    java.lang.Runtime.exec(Runtime.java:566)java.lang.Runtime.exec(Runtime.java:428)
    java.lang.Runtime.exec(Runtime.java:364)java.lang.Runtime.exec(Runtime.java:326)
    myapp.arcs.app.action.StatementProcessParametersAction.saveParameters(StatementProcessParametersAction.java:562)
    myapp.arcs.app.action.ArcsBaseParametersAction.submitParameters(ArcsBaseParametersAction.java:394)sun.reflect.GeneratedMethodAccessor967.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.grnds.structural.struts.icl.IclLookupDispatchAction.dispatchMethod(IclLookupDispatchAction.java:311)
    org.grnds.structural.struts.icl.IclLookupDispatchAction.execute(IclLookupDispatchAction.java:237)
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)w
    weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    myapp.arcs.filter.GZIPFilter.doFilter(GZIPFilter.java:38)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6458)
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)---------------------
    I have done lot of googling on this UNIXProcess.forkAndExec and found out that it is related to our SUN UNIX version 8.0 SWAP space problem. I did one test to reduce the SWAP space to 2 gig from 6 gig and recreated the problem ourself in Testnet.
    Now, i was looking for some answers ....
    1) I do not like forking a process (as it is like creating a new JVM within an already existing JVM) and do stuff from there. Now, what is the best way to implement these forking scenerios within the same JVM (here BEA Weblogic) and NOT forking a new JVM.
    2) Just curiuos --- why does the Unix fork processes uses SWAP space rather than the real memory lying on the Unix box.
    I may be asking this question very awkwardly but this is the best way to write my question from my mind. Iam really confused about all this forking and stuff. So, please ignore me if the answer is asked half baked.
    Thanks,

    also to add to my queries ....
    in our code, we are catching exception like this ....
        catch ( Exception e )
          logger.error( TRACE_TAG + methodName + GENERIC_ERROR +
                        CommonUtils.getStackOutput( e ) );
    }Now, the exception that iam getting is a Runtime exception (correct me if iam wrong though) ...
    My question is (to learn about exception....:))
    isn't Exception is a very high level Exception handling .... does the code need to catch a more specific exception handling like "RuntimeException"

  • Diff between ForEach & ParForEach blocks in BPM

    Hi,
    Can anyone let me know the difference between ForEach & ParForEach blocks? I am aware of the fact that ForEach gets executed sequentially and ParForEach gets executed parallelly from SAP help. But what I require is "Does usage of ParForEach improve the performance, since it executes parallelly, when compared with ForEach which executes sequentially. If not, how does ForEach behave compared with ParForEach?
    Thanks
    Sreeks

    Hi,
    The main difference between the two is the scenarios where they are used,
    parforeach : is mainly used in places where you have to fork for seperate requests, and have to collect individual responses into a single message.
    foreach : is maily used in places where sequencial processing is important or the order of the message has to be preserved by executing.
    As for which is better you could probably judge interms of cost(memory) vs performance. Parforeach forks a seperate flow for each path(thread on java stack + work flow on abap stack), and if your message is huge, you will be having n*message+BPM initialization cost, where n is the number of paths.
    the very nature of Foreach enables recycling of memory and there by for each execution it uses only message+BPM initialization cost.
    Bottom line, use parforeach where you need to use fork-collect pattern.
    Naveen

Maybe you are looking for