Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: don't exit the main thread if a coexp attempted to gc it #362

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

Jafaral
Copy link
Member

@Jafaral Jafaral commented Feb 22, 2024

No description provided.

@Jafaral Jafaral requested a review from Don-Ward February 22, 2024 06:16
Copy link
Collaborator

@Don-Ward Don-Ward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the headline comment is misleading. It says we should never GC the main thread, which is obviously wrong. I think the mod is attempting to stop the recovery of the activation block for the main thread (which makes sense, because nobody activated it).

However, the big problem is that the ci fails. I put the patch into my (up to date) master branch on my local machine and it failed there too.

@@ -1535,6 +1535,8 @@ static void cofree()

xep = *ep;
*ep = (*ep)->nextstk;
if (xep->program == &rootpstate || xep->id == 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes build errors for some configurations.

Copy link
Collaborator

@Don-Ward Don-Ward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK. I'm not sure if the FIXME describes what has been done (and should be removed) or if it is questioning the new code .

#endif /* NO_COEXPR_SEMAPHORE_FIX */
pthread_exit(0);
} else if (cp->id == 1 && cp->id == curtstate->c->id) {
/* FIXME: Main thread, should just return? */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this FIXME be here? If yes, it's new code; why aren't we fixing it now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left it there intentionally because I wasn't there if this has any side effects.

@Jafaral Jafaral changed the title runtime: we should never gc the main thread, workaround fix runtime: don't exit the main thread if a coexp attempted to gc it Feb 22, 2024
@Don-Ward Don-Ward merged commit 090d47a into uniconproject:master Feb 22, 2024
16 checks passed
ValG4 pushed a commit to ValG4/unicon that referenced this pull request Dec 7, 2024
runtime: don't exit the main thread if a coexp attempted to gc it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants