Skip to content

Prevent race condition in parallel build#17

Open
vlmarek wants to merge 1 commit into
BuGlessRB:masterfrom
vlmarek:master
Open

Prevent race condition in parallel build#17
vlmarek wants to merge 1 commit into
BuGlessRB:masterfrom
vlmarek:master

Conversation

@vlmarek
Copy link
Copy Markdown

@vlmarek vlmarek commented Apr 24, 2026

Both make targets 'bins' and 'recommend' eventually need to link against sublib.o. The race happens when both targets are running in parallel and build sublib.o at the same time.

  • both 'bins' and 'recommend' start to compile sublib.o
  • 'recommend' - produces sublib.o
  • 'recommend' - links against sublib.o
  • 'bins' - just now finishes sublib.o overwriting the one from 'recommend'

Now user runs 'make install' and install finds that 'recommend' is older than 'sublib.o' so needs to relink 'recommend'.

Both make targets 'bins' and 'recommend' eventually need to link against
sublib.o. The race happens when both targets are running in parallel and
build sublib.o at the same time.

 - both 'bins' and 'recommend' start to compile sublib.o
 - 'recommend' - produces sublib.o
 - 'recommend' - links against sublib.o
 - 'bins' - just now finishes sublib.o overwriting the one from 'recommend'

Now user runs 'make install' and install finds that 'recommend' is older
than 'sublib.o' so needs to relink 'recommend'.
@BuGlessRB BuGlessRB force-pushed the master branch 4 times, most recently from 4ca880f to ffe0194 Compare May 19, 2026 18:21
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.

1 participant