# Problem of world age in application

**URL:** https://discourse.julialang.org/t/problem-of-world-age-in-application/114803
**Category:** General Usage
**Created:** [May 27, 2024, 9:04pm UTC](https://discourse.julialang.org/t/problem-of-world-age-in-application/114803 "2024-05-27T21:04:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Abdou](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Abdou](https://discourse.julialang.org/u/Abdou)
#### Post date: [May 27, 2024, 9:04pm UTC](https://discourse.julialang.org/t/problem-of-world-age-in-application/114803/1 "2024-05-27T21:04:26Z")

</div>

in graphic application that use Gtk4 and Gadfly I have a function that create functions by Meta parsing and evaluating the text of GtkEntry widget.  
these functions are well accepted in plot function and from the REPL but when I invoke them from signal handlers like those of buttons i get an error saying that the function is too new in the world age to be applicable.  
I don’t undersand this message and don’t know how to solve the problem.  
thanks for any contribution

---

<div class="post-metadata">

### Author: ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)
#### Post date: [May 27, 2024, 9:08pm UTC](https://discourse.julialang.org/t/problem-of-world-age-in-application/114803/2 "2024-05-27T21:08:35Z")

</div>

The basic problem is that you have a long running function and new functions are created while it runs. Due to performance reasons a function can only call older functions essentially. To work around this you need to use `Base.invokelatest`. see e.g. this SO thread for more details

> <https://stackoverflow.com/questions/57749394/why-does-julia-have-base-invokelatest>

---

<div class="post-metadata">

### Author: ![Abdou](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Abdou](https://discourse.julialang.org/u/Abdou)
#### Post date: [May 27, 2024, 10:21pm UTC](https://discourse.julialang.org/t/problem-of-world-age-in-application/114803/3 "2024-05-27T22:21:27Z")

</div>

thank you abraemer I’ll get more information and then test and reply.

---

<div class="post-metadata">

### Author: ![Abdou](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Abdou](https://discourse.julialang.org/u/Abdou)
#### Post date: [May 28, 2024, 8:27pm UTC](https://discourse.julialang.org/t/problem-of-world-age-in-application/114803/4 "2024-05-28T20:27:27Z")

</div>

I tested the Base.invokelatest method as suggested by abraemer but it only wok for one call, in my application I have an array to fill with float values and I receive the same error message about world age when doing so. I tested the Base.invoke\_in\_world with different word counters but the error persist  
it is true that I don’t understand the subject.  
thanks for any suggestions

---

<div class="post-metadata">

### Author: ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)
#### Post date: [May 29, 2024, 4:48am UTC](https://discourse.julialang.org/t/problem-of-world-age-in-application/114803/5 "2024-05-29T04:48:06Z")

</div>

For every call where you get this world age problem you’ll have to use `Base.invokelatest`. Ideally you’d structure the code such that is only in one place.  
Without you providing some code, there is not much else we can do for you.

---

<div class="post-metadata">

### Author: ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)
#### Post date: [May 29, 2024, 5:04am UTC](https://discourse.julialang.org/t/problem-of-world-age-in-application/114803/6 "2024-05-29T05:04:10Z")

</div>

I am not sure whether RuntimeGeneratedFunctions.jl can help here. But you can try it.
