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 9181603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:21:22+00:00 2026-06-17T18:21:22+00:00

I’ve something similar to following pseudo code: for (lets say 10 iterations) begin //

  • 0

I’ve something similar to following pseudo code:

for (lets say 10 iterations)
begin
// Do some configuration changes
    fork
        begin
        ///apply input to design
        end
        begin
        while (1)
        /// at particular point update expected status / values
        end
        begin
        while (1)
        /// read status and verify with expected values
        end
    join_any
end

From code: only application of input can break fork, since other 2 threads are working under while (1)
I want to disable all threads between each iteration of for i.e. once stream of input is applied — disable all spawned threads until next iteration starts (with new configuration)

so I modified above code to

 ....
 join_any
 disable_fork
 end

However this seems to disable for loop as well / or something similar which I don’t understand but effect is test is hung up.
Can someone explain me the reason and solution?

  • 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-06-17T18:21:23+00:00Added an answer on June 17, 2026 at 6:21 pm

    “disable fork” kills not only the processes launched by your fork…join_any, but also any other processes that are descendants of the same process that executes the disable-fork. If you have launched any other processes (using, for example, fork…join_none) earlier in the life of this process, then those other processes will be killed too.

    You can rather easily protect against this by causing your fork…join_any, and its later disable-fork, to run in a new child process of its own. This limits the effect of your disable-fork so that it can affect only the newly launched processes that you care about, and is guaranteed to have no other unwanted effects.

    Do this by enclosing the whole mess in “fork begin…end join” like this:

    fork begin // isolate the following code as a single child process
      fork  // launch the processes you wish to manage
        apply_input();
        update_status();
        verify_status();
      join_any // kill off the *_status threads when apply_input terminates
      disable fork;
    end join // end of child process isolation
    

    This is a well-known issue with fork…join_any and fork…join_none. It’s been discussed recently on Verification Guild forum, and is described in sections #79 and #80 of the Sutherland and Mills book “Verilog and SystemVerilog Gotchas”.

    Putting “fork begin” and “end join” on single lines is unusual, but I like it as a way to make it very obvious that I’m synchronously forking exactly one child process. Normally that would be a useless thing to do, but in this situation it’s essential.

    This idiom is so common, and so easy to get wrong, that you may prefer to encapsulate it in a pair of macros (I don’t like this, but…):

    `define BEGIN_FIRST_OF fork begin fork
    `define END_FIRST_OF join_any disable fork; end join
    

    Now you can write…

    `BEGIN_FIRST_OF
        apply_input();
        update_status();
        verify_status();
    `END_FIRST_OF
    

    where the names “…FIRST_OF” are intended to reflect the similarity to the Specman (e) language construct that does the same thing.

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

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.